public class InstanceSpec extends Object
Constructor and Description |
---|
InstanceSpec(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) |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteDataDirectoryOnClose() |
boolean |
equals(Object o) |
String |
getConnectString()
Deprecated.
|
Map<String,Object> |
getCustomProperties() |
File |
getDataDirectory() |
int |
getElectionPort() |
String |
getHostname() |
int |
getMaxClientCnxns() |
int |
getPort() |
int |
getQuorumPort() |
static int |
getRandomPort() |
int |
getServerId() |
int |
getTickTime() |
int |
hashCode() |
static InstanceSpec |
newInstanceSpec() |
static void |
reset() |
String |
toString() |
public InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId)
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 when TestingCluster.close()
is calledserverId
- the server ID for the instancepublic InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns)
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 when TestingCluster.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 configurationpublic InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String,Object> customProperties)
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 when TestingCluster.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 serverpublic InstanceSpec(File dataDirectory, int port, int electionPort, int quorumPort, boolean deleteDataDirectoryOnClose, int serverId, int tickTime, int maxClientCnxns, Map<String,Object> customProperties, String hostname)
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 when TestingCluster.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 interfacespublic static void reset()
public static InstanceSpec newInstanceSpec()
public static int getRandomPort()
public int getServerId()
public File getDataDirectory()
public int getPort()
public int getElectionPort()
public int getQuorumPort()
@Deprecated public String getConnectString()
TestingServer.getConnectString()
or TestingCluster.getConnectString()
insteadpublic int getTickTime()
public int getMaxClientCnxns()
public boolean deleteDataDirectoryOnClose()
public String getHostname()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.