org.linkedin.zookeeper.server
Class StandaloneZooKeeperServer
java.lang.Object
org.linkedin.zookeeper.server.StandaloneZooKeeperServer
- All Implemented Interfaces:
- org.linkedin.util.lifecycle.Shutdownable, org.linkedin.util.lifecycle.Startable, org.linkedin.util.lifecycle.Terminable
public class StandaloneZooKeeperServer
- extends java.lang.Object
- implements org.linkedin.util.lifecycle.Startable, org.linkedin.util.lifecycle.Shutdownable
Encapsulates creation of a standalone zookeeper server (most likely
going to be used for testing only)
|
Field Summary |
org.linkedin.util.clock.Clock |
clock
|
static org.slf4j.Logger |
log
|
static java.lang.String |
MODULE
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MODULE
public static final java.lang.String MODULE
log
public static final org.slf4j.Logger log
clock
public org.linkedin.util.clock.Clock clock
StandaloneZooKeeperServer
public StandaloneZooKeeperServer(java.lang.String tickTime,
java.lang.String dataDir,
int clientPort)
getClientPort
public int getClientPort()
setClientPort
public void setClientPort(int clientPort)
getDataDir
public java.lang.String getDataDir()
setDataDir
public void setDataDir(java.lang.String dataDir)
getTickTime
public java.lang.String getTickTime()
setTickTime
public void setTickTime(java.lang.String tickTime)
start
public void start()
- Specified by:
start in interface org.linkedin.util.lifecycle.Startable
shutdown
public void shutdown()
- Specified by:
shutdown in interface org.linkedin.util.lifecycle.Shutdownable
waitForShutdown
public void waitForShutdown()
throws java.lang.InterruptedException,
java.lang.IllegalStateException
- Specified by:
waitForShutdown in interface org.linkedin.util.lifecycle.Shutdownable
- Throws:
java.lang.InterruptedException
java.lang.IllegalStateException
waitForShutdown
public void waitForShutdown(java.lang.Object timeout)
throws java.lang.InterruptedException,
java.lang.IllegalStateException,
java.util.concurrent.TimeoutException
- Waits for shutdown to be completed. After calling shutdown, there may still be some pending work
that needs to be accomplised. This method will block until it is done but no longer than the
timeout.
- Specified by:
waitForShutdown in interface org.linkedin.util.lifecycle.Shutdownable
- Parameters:
timeout - how long to wait maximum for the shutdown (see ClockUtils.toTimespan(Object))
- Throws:
java.lang.InterruptedException - if interrupted while waiting
java.lang.IllegalStateException - if shutdown has not been called
java.util.concurrent.TimeoutException - if shutdown still not complete after timeout