@InterfaceAudience.Public public class MiniZooKeeperCluster extends Object
Modifier and Type | Field and Description |
---|---|
static String |
HOST |
static String |
LOOPBACK_HOST |
Constructor and Description |
---|
MiniZooKeeperCluster() |
MiniZooKeeperCluster(org.apache.hadoop.conf.Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
addClientPort(int clientPort)
Add a client port to the list.
|
Address |
getAddress() |
int |
getBackupZooKeeperServerNum() |
int |
getClientPort() |
int |
getZooKeeperServerNum() |
int |
killCurrentActiveZooKeeperServer() |
void |
killOneBackupZooKeeperServer()
Kill one back up ZK servers.
|
void |
setDefaultClientPort(int clientPort) |
void |
setTickTime(int tickTime) |
void |
shutdown() |
int |
startup(File baseDir) |
int |
startup(File baseDir,
int numZooKeeperServers) |
public static final String LOOPBACK_HOST
public MiniZooKeeperCluster()
public MiniZooKeeperCluster(org.apache.hadoop.conf.Configuration configuration)
public void addClientPort(int clientPort)
clientPort
- the specified portpublic void setDefaultClientPort(int clientPort)
public void setTickTime(int tickTime)
public int getBackupZooKeeperServerNum()
public int getZooKeeperServerNum()
public int startup(File baseDir) throws IOException, InterruptedException
IOException
InterruptedException
public int startup(File baseDir, int numZooKeeperServers) throws IOException, InterruptedException
baseDir
- the base directory to usenumZooKeeperServers
- the number of ZooKeeper serversIOException
- if an operation fails during the startupInterruptedException
- if the startup failspublic void shutdown() throws IOException
IOException
- if waiting for the shutdown of a server failspublic int killCurrentActiveZooKeeperServer() throws IOException, InterruptedException
IOException
- if waiting for the shutdown of a server failsInterruptedException
public void killOneBackupZooKeeperServer() throws IOException, InterruptedException
IOException
- if waiting for the shutdown of a server failsInterruptedException
public int getClientPort()
public Address getAddress()
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.