org.apache.curator.test
Class TestingZooKeeperServer

java.lang.Object
  extended by org.apache.zookeeper.server.quorum.QuorumPeerMain
      extended by org.apache.curator.test.TestingZooKeeperServer
All Implemented Interfaces:
Closeable

public class TestingZooKeeperServer
extends org.apache.zookeeper.server.quorum.QuorumPeerMain
implements Closeable

Thanks to Jeremie BORDIER (ahfeel) for this code


Field Summary
 
Fields inherited from class org.apache.zookeeper.server.quorum.QuorumPeerMain
quorumPeer
 
Constructor Summary
TestingZooKeeperServer(QuorumConfigBuilder configBuilder)
           
TestingZooKeeperServer(QuorumConfigBuilder configBuilder, int thisInstanceIndex)
           
 
Method Summary
 void close()
           
 InstanceSpec getInstanceSpec()
           
 Collection<InstanceSpec> getInstanceSpecs()
           
 org.apache.zookeeper.server.quorum.QuorumPeer getQuorumPeer()
           
 void kill()
           
 void restart()
          Restart the server.
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.zookeeper.server.quorum.QuorumPeerMain
initializeAndRun, main, runFromConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestingZooKeeperServer

public TestingZooKeeperServer(QuorumConfigBuilder configBuilder)

TestingZooKeeperServer

public TestingZooKeeperServer(QuorumConfigBuilder configBuilder,
                              int thisInstanceIndex)
Method Detail

getQuorumPeer

public org.apache.zookeeper.server.quorum.QuorumPeer getQuorumPeer()

getInstanceSpecs

public Collection<InstanceSpec> getInstanceSpecs()

kill

public void kill()

restart

public void restart()
             throws Exception
Restart the server. If the server is running it will be stopped and then started again. If it is not running (in a LATENT or STOPPED state) then it will be restarted. If it is in a CLOSED state then an exception will be thrown.

Throws:
Exception

stop

public void stop()
          throws IOException
Throws:
IOException

getInstanceSpec

public InstanceSpec getInstanceSpec()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

start

public void start()
           throws Exception
Throws:
Exception


Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.