public class ZooKeeperMain
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions |
cl |
protected int |
commandCount |
protected static java.util.Map<java.lang.String,java.lang.String> |
commandMap |
protected java.util.HashMap<java.lang.Integer,java.lang.String> |
history |
protected java.lang.String |
host |
protected boolean |
printWatches |
protected ZooKeeper |
zk |
| Constructor and Description |
|---|
ZooKeeperMain(java.lang.String[] args) |
ZooKeeperMain(ZooKeeper zk) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToHistory(int i,
java.lang.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(java.lang.String newHost) |
static boolean |
createQuota(ZooKeeper zk,
java.lang.String path,
long bytes,
int numNodes)
this method creates a quota node for the path
|
static boolean |
delQuota(ZooKeeper zk,
java.lang.String path,
boolean bytes,
boolean numNodes)
this method deletes quota for a node.
|
void |
executeLine(java.lang.String line) |
static java.util.List<java.lang.String> |
getCommands() |
boolean |
getPrintWatches() |
protected java.lang.String |
getPrompt() |
static void |
main(java.lang.String[] args) |
static void |
printMessage(java.lang.String msg) |
protected boolean |
processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) |
protected boolean |
processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) |
protected static final java.util.Map<java.lang.String,java.lang.String> commandMap
protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions cl
protected java.util.HashMap<java.lang.Integer,java.lang.String> history
protected int commandCount
protected boolean printWatches
protected ZooKeeper zk
protected java.lang.String host
public ZooKeeperMain(java.lang.String[] args)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic ZooKeeperMain(ZooKeeper zk)
public boolean getPrintWatches()
protected void addToHistory(int i,
java.lang.String cmd)
public static java.util.List<java.lang.String> getCommands()
protected java.lang.String getPrompt()
public static void printMessage(java.lang.String msg)
protected void connectToZK(java.lang.String newHost)
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedExceptionjava.io.IOExceptionpublic static void main(java.lang.String[] args)
throws KeeperException,
java.io.IOException,
java.lang.InterruptedException
KeeperExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void executeLine(java.lang.String line)
throws java.lang.InterruptedException,
java.io.IOException,
KeeperException
java.lang.InterruptedExceptionjava.io.IOExceptionKeeperExceptionpublic static boolean delQuota(ZooKeeper zk, java.lang.String path, boolean bytes, boolean numNodes) throws KeeperException, java.io.IOException, java.lang.InterruptedException
zk - the zookeeper clientpath - the path to delete quota forbytes - true if number of bytes needs to
be unsetnumNodes - true if number of nodes needs
to be unsetKeeperExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionpublic static boolean createQuota(ZooKeeper zk, java.lang.String path, long bytes, int numNodes) throws KeeperException, java.io.IOException, java.lang.InterruptedException
zk - the ZooKeeper clientpath - the path for which quota needs to be createdbytes - the limit of bytes on this pathnumNodes - the limit of number of nodes on this pathKeeperExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionprotected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
throws KeeperException,
java.io.IOException,
java.lang.InterruptedException
KeeperExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionprotected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
throws KeeperException,
java.io.IOException,
java.lang.InterruptedException
KeeperExceptionjava.io.IOExceptionjava.lang.InterruptedExceptionCopyright © 2016 The Apache Software Foundation