public class SimDistribStateManager extends Object implements DistribStateManager
DistribStateManager that keeps all data locally in a static structure. Instances of this
class are identified by their id in order to simulate the deletion of ephemeral nodes when close() is
invoked.| Modifier and Type | Class and Description |
|---|---|
static class |
SimDistribStateManager.Node
Deprecated.
|
| Constructor and Description |
|---|
SimDistribStateManager()
Deprecated.
|
SimDistribStateManager(ActionThrottle actionThrottle,
ActionError actionError)
Deprecated.
|
SimDistribStateManager(SimDistribStateManager.Node root)
Deprecated.
Construct new state manager that uses provided root node for storing data.
|
SimDistribStateManager(SimDistribStateManager.Node root,
ActionThrottle actionThrottle,
ActionError actionError)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Deprecated.
Clear this instance.
|
void |
close()
Deprecated.
|
void |
copyFrom(DistribStateManager other,
boolean failOnExists)
Deprecated.
Copy all content from another DistribStateManager.
|
String |
createData(String path,
byte[] data,
org.apache.zookeeper.CreateMode mode)
Deprecated.
|
static SimDistribStateManager.Node |
createNewRootNode()
Deprecated.
|
AutoScalingConfig |
getAutoScalingConfig(org.apache.zookeeper.Watcher watcher)
Deprecated.
|
VersionedData |
getData(String path,
org.apache.zookeeper.Watcher watcher)
Deprecated.
|
SimDistribStateManager.Node |
getRoot()
Deprecated.
Get the root node of the tree used by this instance.
|
boolean |
hasData(String path)
Deprecated.
|
List<String> |
listData(String path)
Deprecated.
|
List<String> |
listData(String path,
org.apache.zookeeper.Watcher watcher)
Deprecated.
|
void |
makePath(String path)
Deprecated.
|
void |
makePath(String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode,
boolean failOnExists)
Deprecated.
|
List<org.apache.zookeeper.OpResult> |
multi(Iterable<org.apache.zookeeper.Op> ops)
Deprecated.
|
void |
removeData(String path,
int version)
Deprecated.
|
void |
setData(String path,
byte[] data,
int version)
Deprecated.
|
void |
simSetAutoScalingConfig(AutoScalingConfig cfg)
Deprecated.
|
SimDistribStateManager |
withEphemeralId(String id)
Deprecated.
Create a copy of this instance using a specified ephemeral owner id.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAutoScalingConfig, getData, listTree, removeRecursivelyisClosedpublic SimDistribStateManager()
public SimDistribStateManager(SimDistribStateManager.Node root)
root - if null then a new root node will be created.public SimDistribStateManager(ActionThrottle actionThrottle, ActionError actionError)
public SimDistribStateManager(SimDistribStateManager.Node root, ActionThrottle actionThrottle, ActionError actionError)
public static SimDistribStateManager.Node createNewRootNode()
public void copyFrom(DistribStateManager other, boolean failOnExists) throws InterruptedException, IOException, org.apache.zookeeper.KeeperException, AlreadyExistsException, BadVersionException
other - another state manager.failOnExists - abort copy when one or more paths already exist (the state of this manager remains unchanged).InterruptedExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionAlreadyExistsExceptionBadVersionExceptionpublic SimDistribStateManager withEphemeralId(String id)
id - ephemeral owner idpublic SimDistribStateManager.Node getRoot()
public void clear()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean hasData(String path) throws IOException
hasData in interface DistribStateManagerIOExceptionpublic List<String> listData(String path) throws NoSuchElementException, IOException
listData in interface DistribStateManagerNoSuchElementExceptionIOExceptionpublic List<String> listData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException
listData in interface DistribStateManagerNoSuchElementExceptionIOExceptionpublic VersionedData getData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException
getData in interface DistribStateManagerNoSuchElementExceptionIOExceptionpublic void makePath(String path) throws IOException
makePath in interface DistribStateManagerIOExceptionpublic void makePath(String path, byte[] data, org.apache.zookeeper.CreateMode createMode, boolean failOnExists) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
makePath in interface DistribStateManagerAlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic String createData(String path, byte[] data, org.apache.zookeeper.CreateMode mode) throws AlreadyExistsException, NoSuchElementException, IOException
createData in interface DistribStateManagerAlreadyExistsExceptionNoSuchElementExceptionIOExceptionpublic void removeData(String path, int version) throws NoSuchElementException, NotEmptyException, BadVersionException, IOException
removeData in interface DistribStateManagerNoSuchElementExceptionNotEmptyExceptionBadVersionExceptionIOExceptionpublic void setData(String path, byte[] data, int version) throws NoSuchElementException, BadVersionException, IOException
setData in interface DistribStateManagerNoSuchElementExceptionBadVersionExceptionIOExceptionpublic List<org.apache.zookeeper.OpResult> multi(Iterable<org.apache.zookeeper.Op> ops) throws BadVersionException, NoSuchElementException, AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
multi in interface DistribStateManagerBadVersionExceptionNoSuchElementExceptionAlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic AutoScalingConfig getAutoScalingConfig(org.apache.zookeeper.Watcher watcher) throws InterruptedException, IOException
getAutoScalingConfig in interface DistribStateManagerInterruptedExceptionIOExceptionpublic void simSetAutoScalingConfig(AutoScalingConfig cfg) throws Exception
ExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.