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) |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteDataDirectoryOnClose() |
boolean |
equals(Object o) |
String |
getConnectString() |
File |
getDataDirectory() |
int |
getElectionPort() |
int |
getMaxClientCnxns() |
int |
getPort() |
int |
getQuorumPort() |
static int |
getRandomPort() |
int |
getServerId() |
int |
getTickTime() |
int |
hashCode() |
static InstanceSpec |
newInstanceSpec() |
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 static InstanceSpec newInstanceSpec()
public static int getRandomPort()
public int getServerId()
public File getDataDirectory()
public int getPort()
public int getElectionPort()
public int getQuorumPort()
public String getConnectString()
public int getTickTime()
public int getMaxClientCnxns()
public boolean deleteDataDirectoryOnClose()
Copyright © 2011–2019 The Apache Software Foundation. All rights reserved.