public class MockZooKeeper extends Object implements ZooKeeperIface
| Constructor and Description |
|---|
MockZooKeeper(org.apache.zookeeper.Watcher watcher,
MockZooKeeperDataStore dataStore) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
create(String path,
byte[] data,
List<org.apache.zookeeper.data.ACL> acl,
org.apache.zookeeper.CreateMode createMode) |
void |
delete(String path,
int expectedVersion) |
org.apache.zookeeper.data.Stat |
exists(String path,
boolean watch) |
org.apache.zookeeper.data.Stat |
exists(String path,
org.apache.zookeeper.Watcher watcher) |
List<String> |
getChildren(String path,
boolean watch) |
List<String> |
getChildren(String path,
org.apache.zookeeper.Watcher watcher) |
byte[] |
getData(String path,
boolean watch,
org.apache.zookeeper.data.Stat stat) |
byte[] |
getData(String path,
org.apache.zookeeper.Watcher watcher,
org.apache.zookeeper.data.Stat stat) |
long |
getSessionId() |
org.apache.zookeeper.ZooKeeper.States |
getState() |
org.apache.zookeeper.data.Stat |
setData(String path,
byte[] data,
int expectedVersion) |
void |
triggerConnect() |
void |
triggerDisconnect() |
void |
triggerSessionExpiration() |
public MockZooKeeper(org.apache.zookeeper.Watcher watcher,
MockZooKeeperDataStore dataStore)
public void triggerConnect()
public void triggerDisconnect()
public void triggerSessionExpiration()
public long getSessionId()
getSessionId in interface ZooKeeperIfacepublic void close()
throws InterruptedException
close in interface ZooKeeperIfaceInterruptedExceptionpublic 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 interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void delete(String path, int expectedVersion) throws InterruptedException, org.apache.zookeeper.KeeperException
delete in interface ZooKeeperIfaceInterruptedExceptionorg.apache.zookeeper.KeeperExceptionpublic org.apache.zookeeper.data.Stat exists(String path, org.apache.zookeeper.Watcher watcher) throws org.apache.zookeeper.KeeperException, InterruptedException
exists in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic org.apache.zookeeper.data.Stat exists(String path, boolean watch) throws org.apache.zookeeper.KeeperException, InterruptedException
exists in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] getData(String path, org.apache.zookeeper.Watcher watcher, org.apache.zookeeper.data.Stat stat) throws org.apache.zookeeper.KeeperException, InterruptedException
getData in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic byte[] getData(String path, boolean watch, org.apache.zookeeper.data.Stat stat) throws org.apache.zookeeper.KeeperException, InterruptedException
getData in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic org.apache.zookeeper.data.Stat setData(String path, byte[] data, int expectedVersion) throws org.apache.zookeeper.KeeperException, InterruptedException
setData in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic List<String> getChildren(String path, org.apache.zookeeper.Watcher watcher) throws org.apache.zookeeper.KeeperException, InterruptedException
getChildren in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic List<String> getChildren(String path, boolean watch) throws org.apache.zookeeper.KeeperException, InterruptedException
getChildren in interface ZooKeeperIfaceorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic org.apache.zookeeper.ZooKeeper.States getState()
getState in interface ZooKeeperIfaceCopyright © 2012–2015 Facebook, Inc.. All rights reserved.