@InterfaceAudience.Public public class ZooKeeperMain extends Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.zookeeper.ZooKeeperMain.MyCommandOptions |
cl |
protected int |
commandCount |
protected int |
exitCode |
protected HashMap<Integer,String> |
history |
protected String |
host |
protected boolean |
printWatches |
protected ZooKeeper |
zk |
Constructor and Description |
---|
ZooKeeperMain(String[] args) |
ZooKeeperMain(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(ZooKeeper zk,
String path,
long bytes,
int numNodes)
this method creates a quota node for the path
|
static boolean |
delQuota(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 int exitCode
protected ZooKeeper zk
protected String host
public ZooKeeperMain(String[] args) throws IOException, InterruptedException
IOException
InterruptedException
public ZooKeeperMain(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
InterruptedException
IOException
public static void main(String[] args) throws CliException, IOException, InterruptedException
public void executeLine(String line) throws CliException, InterruptedException, IOException
public static boolean delQuota(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 unsetKeeperException
IOException
InterruptedException
public static boolean createQuota(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 pathKeeperException
IOException
InterruptedException
protected boolean processCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws CliException, IOException, InterruptedException
protected boolean processZKCmd(org.apache.zookeeper.ZooKeeperMain.MyCommandOptions co) throws CliException, IOException, InterruptedException
Copyright © 2008–2019 The Apache Software Foundation. All rights reserved.