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 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 /protected void
connectToZK(String newHost)
void
executeLine(String line)
static List<String>
getCommands()
boolean
getPrintWatches()
protected String
getPrompt()
static void
main(String[] args)
static void
printMessage(String msg)
protected boolean
processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
protected boolean
processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
-
-
-
Constructor Detail
-
ZooKeeperMain
public ZooKeeperMain(String[] args) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
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:
InterruptedException
IOException
-
main
public static void main(String[] args) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
executeLine
public void executeLine(String line) throws InterruptedException, IOException
- Throws:
InterruptedException
IOException
-
processCmd
protected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
processZKCmd
protected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws CliException, IOException, InterruptedException
-
-