public class ZKClient extends org.linkedin.zookeeper.client.AbstractZKClient implements org.apache.zookeeper.Watcher
| Modifier and Type | Class and Description |
|---|---|
static class |
ZKClient.State |
| Modifier and Type | Field and Description |
|---|---|
protected org.linkedin.zookeeper.client.IZooKeeperFactory |
_factory |
protected Object |
_lock |
protected org.linkedin.util.clock.Timespan |
_reconnectTimeout |
protected ZKClient.State |
_state |
protected org.linkedin.zookeeper.client.IZooKeeper |
_zk |
protected org.linkedin.util.clock.Timespan |
sessionTimeout |
| Constructor and Description |
|---|
ZKClient(org.linkedin.zookeeper.client.IZooKeeperFactory factory)
Constructor
|
ZKClient(org.linkedin.zookeeper.client.IZooKeeperFactory factory,
String chroot)
Constructor
|
ZKClient(String connectString,
org.linkedin.util.clock.Timespan sessionTimeout,
org.apache.zookeeper.Watcher watcher)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Map<Object,Boolean> |
callListeners(Map<Object,Boolean> history,
Boolean connectedEvent) |
protected Object |
callMethod(Object obj,
String name,
Object... args) |
protected void |
changeState(ZKClient.State newState) |
org.linkedin.zookeeper.client.IZKClient |
chroot(String path) |
void |
close() |
void |
connect() |
String |
create(String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode) |
String |
create(String path,
org.apache.zookeeper.CreateMode createMode) |
String |
create(String path,
String data,
org.apache.zookeeper.CreateMode createMode) |
org.apache.zookeeper.data.Stat |
createOrSetByteWithParents(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode createMode) |
org.apache.zookeeper.data.Stat |
createOrSetWithParents(String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode) |
org.apache.zookeeper.data.Stat |
createOrSetWithParents(String path,
String data,
org.apache.zookeeper.CreateMode createMode) |
String |
createWithParents(String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode) |
String |
createWithParents(String path,
org.apache.zookeeper.CreateMode createMode) |
String |
createWithParents(String path,
String data,
org.apache.zookeeper.CreateMode createMode) |
protected String |
doGetNodeACLs(String path) |
protected void |
doStart() |
void |
fixACLs(String path,
boolean recursive) |
String |
getConnectString() |
protected Object |
getField(Object obj,
String... names) |
protected Object |
getField(Object obj,
String name) |
protected Thread |
getSendThread() |
protected org.linkedin.zookeeper.client.IZooKeeper |
getZk() |
boolean |
isConfigured() |
boolean |
isConnected() |
void |
process(org.apache.zookeeper.WatchedEvent event) |
void |
registerListener(org.linkedin.zookeeper.client.LifecycleListener listener) |
void |
removeListener(org.linkedin.zookeeper.client.LifecycleListener listener) |
void |
setACLs(Map<String,String> acls) |
void |
setPassword(String password) |
void |
start() |
void |
testGenerateConnectionLoss() |
protected void |
tryConnect() |
void |
waitForConnected() |
void |
waitForConnected(org.linkedin.util.clock.Timespan timeout) |
void |
waitForState(ZKClient.State state,
org.linkedin.util.clock.Timespan timeout) |
create, createBytesNode, createBytesNodeWithParents, createOrSetWithParents, createWithParents, delete, deleteWithChildren, exists, getAllChildren, getChildren, getData, getStringData, getZKByteData, getZKByteData, getZKChildren, getZKStringData, getZKStringData, setByteData, setDataaddAuthInfo, adjustPath, adjustPath, create, create, delete, delete, exists, exists, exists, exists, getACL, getACL, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getData, getData, getData, getData, getSessionId, getSessionPasswd, getSessionTimeout, getState, register, setACL, setACL, setData, setData, syncclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAuthInfo, create, create, delete, delete, exists, exists, exists, exists, getACL, getACL, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getData, getData, getData, getData, getSessionId, getSessionPasswd, getSessionTimeout, getState, register, setACL, setACL, setData, setData, syncprotected volatile ZKClient.State _state
protected org.linkedin.zookeeper.client.IZooKeeperFactory _factory
protected org.linkedin.zookeeper.client.IZooKeeper _zk
protected org.linkedin.util.clock.Timespan _reconnectTimeout
protected org.linkedin.util.clock.Timespan sessionTimeout
public ZKClient(String connectString, org.linkedin.util.clock.Timespan sessionTimeout, org.apache.zookeeper.Watcher watcher)
public ZKClient(org.linkedin.zookeeper.client.IZooKeeperFactory factory)
public void setPassword(String password)
protected void doStart() throws org.osgi.framework.InvalidSyntaxException, org.osgi.service.cm.ConfigurationException, UnsupportedEncodingException
org.osgi.framework.InvalidSyntaxExceptionorg.osgi.service.cm.ConfigurationExceptionUnsupportedEncodingExceptionpublic void close()
close in interface org.linkedin.zookeeper.client.IZooKeeperclose in class org.linkedin.zookeeper.client.AbstractZooKeeperprotected Thread getSendThread()
protected void changeState(ZKClient.State newState)
public void testGenerateConnectionLoss() throws Exception
Exceptionprotected Object callMethod(Object obj, String name, Object... args) throws Exception
Exceptionprotected void tryConnect()
public void connect() throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void process(org.apache.zookeeper.WatchedEvent event)
process in interface org.apache.zookeeper.Watcherprotected org.linkedin.zookeeper.client.IZooKeeper getZk()
getZk in class org.linkedin.zookeeper.client.AbstractZooKeeperpublic void waitForConnected(org.linkedin.util.clock.Timespan timeout) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic void waitForConnected() throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionpublic void waitForState(ZKClient.State state, org.linkedin.util.clock.Timespan timeout) throws TimeoutException, InterruptedException
TimeoutExceptionInterruptedExceptionpublic void registerListener(org.linkedin.zookeeper.client.LifecycleListener listener)
registerListener in interface org.linkedin.zookeeper.client.IZKClientpublic void removeListener(org.linkedin.zookeeper.client.LifecycleListener listener)
removeListener in interface org.linkedin.zookeeper.client.IZKClientpublic org.linkedin.zookeeper.client.IZKClient chroot(String path)
chroot in interface org.linkedin.zookeeper.client.IZKClientpublic boolean isConnected()
isConnected in interface org.linkedin.zookeeper.client.IZKClientpublic boolean isConfigured()
public String getConnectString()
getConnectString in interface org.linkedin.zookeeper.client.IZKClientprotected Map<Object,Boolean> callListeners(Map<Object,Boolean> history, Boolean connectedEvent)
public org.apache.zookeeper.data.Stat createOrSetByteWithParents(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String create(String path, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String create(String path, String data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String create(String path, byte[] data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String createWithParents(String path, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String createWithParents(String path, String data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic String createWithParents(String path, byte[] data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic org.apache.zookeeper.data.Stat createOrSetWithParents(String path, String data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic org.apache.zookeeper.data.Stat createOrSetWithParents(String path, byte[] data, org.apache.zookeeper.CreateMode createMode) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic void fixACLs(String path, boolean recursive) throws InterruptedException, org.apache.zookeeper.KeeperException
InterruptedExceptionorg.apache.zookeeper.KeeperExceptionprotected String doGetNodeACLs(String path)
Copyright © 2005–2015 FuseSource, Corp.. All rights reserved.