@InterfaceAudience.Public public class ZooKeeperMain extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions |
cl |
protected int |
commandCount |
protected HashMap<Integer,String> |
history |
protected String |
host |
protected boolean |
printWatches |
protected org.apache.zookeeper.ZooKeeper |
zk |
| Constructor and Description |
|---|
ZooKeeperMain(String[] args) |
ZooKeeperMain(org.apache.zookeeper.ZooKeeper zk) |
| Modifier and Type | Method and 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) |
static boolean |
createQuota(org.apache.zookeeper.ZooKeeper zk,
String path,
long bytes,
int numNodes)
this method creates a quota node for the path
|
static boolean |
delQuota(org.apache.zookeeper.ZooKeeper zk,
String path,
boolean bytes,
boolean numNodes)
this method deletes quota for a node.
|
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) |
protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions cl
protected int commandCount
protected boolean printWatches
protected org.apache.zookeeper.ZooKeeper zk
protected String host
public ZooKeeperMain(String[] args) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic ZooKeeperMain(org.apache.zookeeper.ZooKeeper zk)
public boolean getPrintWatches()
protected void addToHistory(int i,
String cmd)
protected String getPrompt()
public static void printMessage(String msg)
protected void connectToZK(String newHost) throws InterruptedException, IOException
InterruptedExceptionIOExceptionpublic static void main(String[] args) throws KeeperException, IOException, InterruptedException
public void executeLine(String line) throws InterruptedException, IOException, KeeperException
public static boolean delQuota(org.apache.zookeeper.ZooKeeper zk,
String path,
boolean bytes,
boolean numNodes)
throws KeeperException,
IOException,
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 unsetKeeperExceptionIOExceptionInterruptedExceptionpublic static boolean createQuota(org.apache.zookeeper.ZooKeeper zk,
String path,
long bytes,
int numNodes)
throws KeeperException,
IOException,
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 pathKeeperExceptionIOExceptionInterruptedExceptionprotected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
throws KeeperException,
IOException,
InterruptedException
protected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co)
throws KeeperException,
IOException,
InterruptedException
Copyright © 2022 The Apache Software Foundation. All rights reserved.