public class ZooKeeperRetry extends ZooKeeper
ZooKeeper
and will automatically retry calls to
zookeeper if a KeeperException.ConnectionLossException
occursZooKeeper.States, ZooKeeper.WatchRegistration
cnxn, hostProvider, SECURE_CLIENT, watchManager, ZOOKEEPER_CLIENT_CNXN_SOCKET
Constructor and Description |
---|
ZooKeeperRetry(String connectString,
int sessionTimeout,
Watcher watcher) |
ZooKeeperRetry(String connectString,
int sessionTimeout,
Watcher watcher,
long sessionId,
byte[] sessionPasswd) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
String |
create(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
CreateMode createMode) |
void |
delete(String path,
int version) |
org.apache.zookeeper.data.Stat |
exists(String path,
boolean watch) |
org.apache.zookeeper.data.Stat |
exists(String path,
Watcher watcher) |
List<org.apache.zookeeper.data.ACL> |
getACL(String path,
org.apache.zookeeper.data.Stat stat) |
List<String> |
getChildren(String path,
boolean watch) |
List<String> |
getChildren(String path,
Watcher watcher) |
byte[] |
getData(String path,
boolean watch,
org.apache.zookeeper.data.Stat stat) |
byte[] |
getData(String path,
Watcher watcher,
org.apache.zookeeper.data.Stat stat) |
org.apache.zookeeper.data.Stat |
setACL(String path,
List<org.apache.zookeeper.data.ACL> acl,
int aclVersion) |
org.apache.zookeeper.data.Stat |
setData(String path,
byte[] data,
int version) |
void |
setRetryLimit(int limit) |
boolean |
testConnection() |
addAuthInfo, close, create, create, create, create, create, createConnection, defaultWatchManager, delete, exists, exists, getACL, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getChildWatches, getClientConfig, getConfig, getConfig, getConfig, getConfig, getData, getData, getDataWatches, getExistWatches, getSaslClient, getSessionId, getSessionPasswd, getSessionTimeout, getState, getTestable, internalReconfig, internalReconfig, internalReconfig, internalReconfig, multi, multi, multiInternal, multiInternal, reconfig, reconfig, reconfig, reconfig, register, removeAllWatches, removeAllWatches, removeWatches, removeWatches, setACL, setData, sync, testableLocalSocketAddress, testableRemoteSocketAddress, testableWaitForShutdown, toString, transaction, updateServerList
public ZooKeeperRetry(String connectString, int sessionTimeout, Watcher watcher) throws IOException
connectString
- sessionTimeout
- watcher
- IOException
public ZooKeeperRetry(String connectString, int sessionTimeout, Watcher watcher, long sessionId, byte[] sessionPasswd) throws IOException
connectString
- sessionTimeout
- watcher
- sessionId
- sessionPasswd
- IOException
public void close() throws InterruptedException
close
in interface AutoCloseable
close
in class ZooKeeper
InterruptedException
public String create(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl, CreateMode createMode) throws KeeperException, InterruptedException
create
in class ZooKeeper
KeeperException
InterruptedException
public void delete(String path, int version) throws InterruptedException, KeeperException
delete
in class ZooKeeper
InterruptedException
KeeperException
public org.apache.zookeeper.data.Stat exists(String path, boolean watch) throws KeeperException, InterruptedException
exists
in class ZooKeeper
KeeperException
InterruptedException
public org.apache.zookeeper.data.Stat exists(String path, Watcher watcher) throws KeeperException, InterruptedException
exists
in class ZooKeeper
KeeperException
InterruptedException
public List<org.apache.zookeeper.data.ACL> getACL(String path, org.apache.zookeeper.data.Stat stat) throws KeeperException, InterruptedException
getACL
in class ZooKeeper
KeeperException
InterruptedException
public List<String> getChildren(String path, boolean watch) throws KeeperException, InterruptedException
getChildren
in class ZooKeeper
KeeperException
InterruptedException
public List<String> getChildren(String path, Watcher watcher) throws KeeperException, InterruptedException
getChildren
in class ZooKeeper
KeeperException
InterruptedException
public byte[] getData(String path, boolean watch, org.apache.zookeeper.data.Stat stat) throws KeeperException, InterruptedException
getData
in class ZooKeeper
KeeperException
InterruptedException
public byte[] getData(String path, Watcher watcher, org.apache.zookeeper.data.Stat stat) throws KeeperException, InterruptedException
getData
in class ZooKeeper
KeeperException
InterruptedException
public org.apache.zookeeper.data.Stat setACL(String path, List<org.apache.zookeeper.data.ACL> acl, int aclVersion) throws KeeperException, InterruptedException
setACL
in class ZooKeeper
KeeperException
InterruptedException
public org.apache.zookeeper.data.Stat setData(String path, byte[] data, int version) throws KeeperException, InterruptedException
setData
in class ZooKeeper
KeeperException
InterruptedException
public void setRetryLimit(int limit)
limit
- public boolean testConnection()
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.