Package org.apache.zookeeper
Class ZooKeeperMain
- java.lang.Object
-
- org.apache.zookeeper.ZooKeeperMain
-
@Public public class ZooKeeperMain extends Object
The command line client to ZooKeeper.
-
-
Constructor Summary
Constructors Constructor Description ZooKeeperMain(String[] args)ZooKeeperMain(ZooKeeper zk)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToHistory(int i, String cmd)Makes a list of possible completions, either for commands or for zk nodes if the token to complete begins with /protected voidconnectToZK(String newHost)voidexecuteLine(String line)static List<String>getCommands()booleangetPrintWatches()protected StringgetPrompt()static voidmain(String[] args)static voidprintMessage(String msg)protected booleanprocessCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)protected booleanprocessZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
-
-
-
Constructor Detail
-
ZooKeeperMain
public ZooKeeperMain(String[] args) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
ZooKeeperMain
public ZooKeeperMain(ZooKeeper zk)
-
-
Method Detail
-
getPrintWatches
public boolean getPrintWatches()
-
addToHistory
protected void addToHistory(int i, String cmd)Makes a list of possible completions, either for commands or for zk nodes if the token to complete begins with /
-
getPrompt
protected String getPrompt()
-
printMessage
public static void printMessage(String msg)
-
connectToZK
protected void connectToZK(String newHost) throws InterruptedException, IOException
- Throws:
InterruptedExceptionIOException
-
main
public static void main(String[] args) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
executeLine
public void executeLine(String line) throws InterruptedException, IOException
- Throws:
InterruptedExceptionIOException
-
processCmd
protected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
processZKCmd
protected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws CliException, IOException, InterruptedException
-
-