public class MockZooKeeper
extends org.apache.zookeeper.ZooKeeper
| Modifier and Type | Class and Description |
|---|---|
static class |
MockZooKeeper.Op |
| Modifier and Type | Method and Description |
|---|---|
void |
addWatch(String basePath,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.AddWatchMode mode) |
void |
addWatch(String basePath,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.AddWatchMode mode,
org.apache.zookeeper.AsyncCallback.VoidCallback cb,
Object ctx) |
void |
close() |
String |
create(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode createMode) |
void |
create(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode createMode,
org.apache.zookeeper.AsyncCallback.StringCallback cb,
Object ctx) |
void |
delete(String path,
int version) |
void |
delete(String path,
int version,
org.apache.zookeeper.AsyncCallback.VoidCallback cb,
Object ctx) |
org.apache.zookeeper.data.Stat |
exists(String path,
boolean watch) |
void |
exists(String path,
boolean watch,
org.apache.zookeeper.AsyncCallback.StatCallback cb,
Object ctx) |
org.apache.zookeeper.data.Stat |
exists(String path,
org.apache.zookeeper.Watcher watcher) |
void |
exists(String path,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.AsyncCallback.StatCallback cb,
Object ctx) |
void |
failConditional(org.apache.zookeeper.KeeperException.Code rc,
BiPredicate<MockZooKeeper.Op,String> predicate) |
List<String> |
getChildren(String path,
boolean watch) |
void |
getChildren(String path,
boolean watcher,
org.apache.zookeeper.AsyncCallback.Children2Callback cb,
Object ctx) |
List<String> |
getChildren(String path,
org.apache.zookeeper.Watcher watcher) |
void |
getChildren(String path,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.AsyncCallback.ChildrenCallback cb,
Object ctx) |
void |
getData(String path,
boolean watch,
org.apache.zookeeper.AsyncCallback.DataCallback cb,
Object ctx) |
void |
getData(String path,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.AsyncCallback.DataCallback cb,
Object ctx) |
byte[] |
getData(String path,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.data.Stat stat) |
protected long |
getEphemeralOwner() |
long |
getSessionId() |
int |
getSessionTimeout() |
org.apache.zookeeper.ZooKeeper.States |
getState() |
List<org.apache.zookeeper.OpResult> |
multi(Iterable<org.apache.zookeeper.Op> ops) |
void |
multi(Iterable<org.apache.zookeeper.Op> ops,
org.apache.zookeeper.AsyncCallback.MultiCallback cb,
Object ctx) |
static MockZooKeeper |
newInstance() |
static MockZooKeeper |
newInstance(ExecutorService executor) |
static MockZooKeeper |
newInstance(ExecutorService executor,
int readOpDelayMs) |
static MockZooKeeper |
newInstanceForGlobalZK(ExecutorService executor) |
static MockZooKeeper |
newInstanceForGlobalZK(ExecutorService executor,
int readOpDelayMs) |
void |
overrideEpheralOwner(long epheralOwner) |
void |
register(org.apache.zookeeper.Watcher watcher) |
void |
removeEpheralOwnerOverride() |
void |
setAlwaysFail(org.apache.zookeeper.KeeperException.Code rc) |
org.apache.zookeeper.data.Stat |
setData(String path,
byte[] data,
int version) |
void |
setData(String path,
byte[] data,
int version,
org.apache.zookeeper.AsyncCallback.StatCallback cb,
Object ctx) |
void |
setSessionId(long id) |
void |
shutdown() |
void |
sync(String path,
org.apache.zookeeper.AsyncCallback.VoidCallback cb,
Object ctx) |
String |
toString() |
void |
unsetAlwaysFail() |
addAuthInfo, addWatch, addWatch, close, create, create, create, create, getACL, getACL, getAllChildrenNumber, getAllChildrenNumber, getChildren, getChildren, getChildren, getChildren, getChildWatches, getClientConfig, getConfig, getConfig, getConfig, getConfig, getData, getDataWatches, getEphemerals, getEphemerals, getEphemerals, getEphemerals, getExistWatches, getPersistentRecursiveWatches, getPersistentWatches, getSaslClient, getSessionPasswd, getTestable, multiInternal, multiInternal, removeAllWatches, removeAllWatches, removeWatches, removeWatches, setACL, setACL, testableLocalSocketAddress, testableRemoteSocketAddress, testableWaitForShutdown, transaction, updateServerList, whoAmIpublic static MockZooKeeper newInstance()
public static MockZooKeeper newInstance(ExecutorService executor)
public static MockZooKeeper newInstanceForGlobalZK(ExecutorService executor)
public static MockZooKeeper newInstanceForGlobalZK(ExecutorService executor, int readOpDelayMs)
public static MockZooKeeper newInstance(ExecutorService executor, int readOpDelayMs)
public int getSessionTimeout()
getSessionTimeout in class org.apache.zookeeper.ZooKeeperpublic org.apache.zookeeper.ZooKeeper.States getState()
getState in class org.apache.zookeeper.ZooKeeperpublic void register(org.apache.zookeeper.Watcher watcher)
register in class org.apache.zookeeper.ZooKeeperpublic String create(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl, org.apache.zookeeper.CreateMode createMode) throws org.apache.zookeeper.KeeperException, InterruptedException
create in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionInterruptedExceptionprotected long getEphemeralOwner()
public void overrideEpheralOwner(long epheralOwner)
public void removeEpheralOwnerOverride()
public void create(String path, byte[] data, List<org.apache.zookeeper.data.ACL> acl, org.apache.zookeeper.CreateMode createMode, org.apache.zookeeper.AsyncCallback.StringCallback cb, Object ctx)
create in class org.apache.zookeeper.ZooKeeperpublic byte[] getData(String path, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.data.Stat stat) throws org.apache.zookeeper.KeeperException
getData in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionpublic void getData(String path, boolean watch, org.apache.zookeeper.AsyncCallback.DataCallback cb, Object ctx)
getData in class org.apache.zookeeper.ZooKeeperpublic void getData(String path, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.AsyncCallback.DataCallback cb, Object ctx)
getData in class org.apache.zookeeper.ZooKeeperpublic void getChildren(String path, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.AsyncCallback.ChildrenCallback cb, Object ctx)
getChildren in class org.apache.zookeeper.ZooKeeperpublic List<String> getChildren(String path, org.apache.zookeeper.Watcher watcher) throws org.apache.zookeeper.KeeperException
getChildren in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionpublic List<String> getChildren(String path, boolean watch) throws org.apache.zookeeper.KeeperException, InterruptedException
getChildren in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void getChildren(String path, boolean watcher, org.apache.zookeeper.AsyncCallback.Children2Callback cb, Object ctx)
getChildren in class org.apache.zookeeper.ZooKeeperpublic org.apache.zookeeper.data.Stat exists(String path, boolean watch) throws org.apache.zookeeper.KeeperException, InterruptedException
exists in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic org.apache.zookeeper.data.Stat exists(String path, org.apache.zookeeper.Watcher watcher) throws org.apache.zookeeper.KeeperException, InterruptedException
exists in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void exists(String path, boolean watch, org.apache.zookeeper.AsyncCallback.StatCallback cb, Object ctx)
exists in class org.apache.zookeeper.ZooKeeperpublic void exists(String path, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.AsyncCallback.StatCallback cb, Object ctx)
exists in class org.apache.zookeeper.ZooKeeperpublic void sync(String path, org.apache.zookeeper.AsyncCallback.VoidCallback cb, Object ctx)
sync in class org.apache.zookeeper.ZooKeeperpublic org.apache.zookeeper.data.Stat setData(String path, byte[] data, int version) throws org.apache.zookeeper.KeeperException, InterruptedException
setData in class org.apache.zookeeper.ZooKeeperorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void setData(String path, byte[] data, int version, org.apache.zookeeper.AsyncCallback.StatCallback cb, Object ctx)
setData in class org.apache.zookeeper.ZooKeeperpublic void delete(String path, int version) throws InterruptedException, org.apache.zookeeper.KeeperException
delete in class org.apache.zookeeper.ZooKeeperInterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic void delete(String path, int version, org.apache.zookeeper.AsyncCallback.VoidCallback cb, Object ctx)
delete in class org.apache.zookeeper.ZooKeeperpublic void multi(Iterable<org.apache.zookeeper.Op> ops, org.apache.zookeeper.AsyncCallback.MultiCallback cb, Object ctx)
multi in class org.apache.zookeeper.ZooKeeperpublic List<org.apache.zookeeper.OpResult> multi(Iterable<org.apache.zookeeper.Op> ops) throws InterruptedException, org.apache.zookeeper.KeeperException
multi in class org.apache.zookeeper.ZooKeeperInterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic void addWatch(String basePath, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.AddWatchMode mode)
addWatch in class org.apache.zookeeper.ZooKeeperpublic void addWatch(String basePath, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.AddWatchMode mode, org.apache.zookeeper.AsyncCallback.VoidCallback cb, Object ctx)
addWatch in class org.apache.zookeeper.ZooKeeperpublic void close()
throws InterruptedException
close in interface AutoCloseableclose in class org.apache.zookeeper.ZooKeeperInterruptedExceptionpublic void shutdown()
throws InterruptedException
InterruptedExceptionpublic void failConditional(org.apache.zookeeper.KeeperException.Code rc,
BiPredicate<MockZooKeeper.Op,String> predicate)
public void setAlwaysFail(org.apache.zookeeper.KeeperException.Code rc)
public void unsetAlwaysFail()
public void setSessionId(long id)
public long getSessionId()
getSessionId in class org.apache.zookeeper.ZooKeeperpublic String toString()
toString in class org.apache.zookeeper.ZooKeeperCopyright © 2017–2022 Apache Software Foundation. All rights reserved.