Package org.apache.curator.test
Class InstanceSpec
java.lang.Object
org.apache.curator.test.InstanceSpec
Abstracts one of the servers in the ensemble
-
Constructor Summary
ConstructorDescriptionInstanceSpec
(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) InstanceSpec
(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) InstanceSpec
(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String, Object> customProperties) InstanceSpec
(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String, Object> customProperties, String hostname) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Deprecated.int
int
int
getPort()
int
static int
int
int
int
hashCode()
static InstanceSpec
static void
reset()
toString()
-
Constructor Details
-
InstanceSpec
public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId) - Parameters:
dataDirectory
- where to store data/logs/etc.port
- the port to listen on - each server in the ensemble must use a unique portelectionPort
- the electionPort to listen on - each server in the ensemble must use a unique electionPortquorumPort
- the quorumPort to listen on - each server in the ensemble must use a unique quorumPortdeleteDataDirectoryOnClose
- if true, the data directory will be deleted whenTestingCluster.close()
is calledserverId
- the server ID for the instance
-
InstanceSpec
public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns) - Parameters:
dataDirectory
- where to store data/logs/etc.port
- the port to listen on - each server in the ensemble must use a unique portelectionPort
- the electionPort to listen on - each server in the ensemble must use a unique electionPortquorumPort
- the quorumPort to listen on - each server in the ensemble must use a unique quorumPortdeleteDataDirectoryOnClose
- if true, the data directory will be deleted whenTestingCluster.close()
is calledserverId
- the server ID for the instancetickTime
- tickTime. Set -1 to used fault server configurationmaxClientCnxns
- max number of client connections from the same IP. Set -1 to use default server configuration
-
InstanceSpec
public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String, Object> customProperties) - Parameters:
dataDirectory
- where to store data/logs/etc.port
- the port to listen on - each server in the ensemble must use a unique portelectionPort
- the electionPort to listen on - each server in the ensemble must use a unique electionPortquorumPort
- the quorumPort to listen on - each server in the ensemble must use a unique quorumPortdeleteDataDirectoryOnClose
- if true, the data directory will be deleted whenTestingCluster.close()
is calledserverId
- the server ID for the instancetickTime
- tickTime. Set -1 to used fault server configurationmaxClientCnxns
- max number of client connections from the same IP. Set -1 to use default server configurationcustomProperties
- other properties to be passed to the server
-
InstanceSpec
public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String, Object> customProperties, String hostname) - Parameters:
dataDirectory
- where to store data/logs/etc.port
- the port to listen on - each server in the ensemble must use a unique portelectionPort
- the electionPort to listen on - each server in the ensemble must use a unique electionPortquorumPort
- the quorumPort to listen on - each server in the ensemble must use a unique quorumPortdeleteDataDirectoryOnClose
- if true, the data directory will be deleted whenTestingCluster.close()
is calledserverId
- the server ID for the instancetickTime
- tickTime. Set -1 to used fault server configurationmaxClientCnxns
- max number of client connections from the same IP. Set -1 to use default server configurationcustomProperties
- other properties to be passed to the serverhostname
- Hostname or IP if the cluster is intending to be bounded into external interfaces
-
-
Method Details
-
reset
public static void reset() -
newInstanceSpec
-
getRandomPort
public static int getRandomPort() -
getServerId
public int getServerId() -
getDataDirectory
-
getPort
public int getPort() -
getElectionPort
public int getElectionPort() -
getQuorumPort
public int getQuorumPort() -
getConnectString
Deprecated. -
getTickTime
public int getTickTime() -
getMaxClientCnxns
public int getMaxClientCnxns() -
deleteDataDirectoryOnClose
public boolean deleteDataDirectoryOnClose() -
getCustomProperties
-
getHostname
-
toString
-
equals
-
hashCode
public int hashCode()
-
TestingServer.getConnectString()
orTestingCluster.getConnectString()
instead