org.apache.hadoop.hbase.zookeeper
Class MiniZooKeeperCluster

java.lang.Object
  extended by org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster

public class MiniZooKeeperCluster
extends Object

TODO: Most of the code in this class is ripped from ZooKeeper tests. Instead of redoing it, we should contribute updates to their code which let us more easily access testing helper objects.


Constructor Summary
MiniZooKeeperCluster()
           
MiniZooKeeperCluster(org.apache.hadoop.conf.Configuration configuration)
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiniZooKeeperCluster

public MiniZooKeeperCluster()

MiniZooKeeperCluster

public MiniZooKeeperCluster(org.apache.hadoop.conf.Configuration configuration)
Method Detail

setDefaultClientPort

public void setDefaultClientPort(int clientPort)

setTickTime

public void setTickTime(int tickTime)

getBackupZooKeeperServerNum

public int getBackupZooKeeperServerNum()

getZooKeeperServerNum

public int getZooKeeperServerNum()

startup

public int startup(File baseDir)
            throws IOException,
                   InterruptedException
Throws:
IOException
InterruptedException

startup

public int startup(File baseDir,
                   int numZooKeeperServers)
            throws IOException,
                   InterruptedException
Parameters:
baseDir -
numZooKeeperServers -
Returns:
ClientPort server bound to.
Throws:
IOException
InterruptedException

shutdown

public void shutdown()
              throws IOException
Throws:
IOException

killCurrentActiveZooKeeperServer

public int killCurrentActiveZooKeeperServer()
                                     throws IOException,
                                            InterruptedException
Returns:
clientPort return clientPort if there is another ZK backup can run when killing the current active; return -1, if there is no backups.
Throws:
IOException
InterruptedException

killOneBackupZooKeeperServer

public void killOneBackupZooKeeperServer()
                                  throws IOException,
                                         InterruptedException
Kill one back up ZK servers

Throws:
IOException
InterruptedException

getClientPort

public int getClientPort()


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.