public class SnapshotDistribStateManager extends Object implements DistribStateManager
DistribStateManager| Constructor and Description |
|---|
SnapshotDistribStateManager(DistribStateManager other,
AutoScalingConfig config)
Populate this instance from another
DistribStateManager instance. |
SnapshotDistribStateManager(Map<String,Object> snapshot)
Populate this instance from a previously generated snapshot.
|
SnapshotDistribStateManager(Map<String,Object> snapshot,
AutoScalingConfig config)
Populate this instance from a previously generated snapshot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
createData(String path,
byte[] data,
org.apache.zookeeper.CreateMode mode) |
AutoScalingConfig |
getAutoScalingConfig(org.apache.zookeeper.Watcher watcher) |
VersionedData |
getData(String path,
org.apache.zookeeper.Watcher watcher) |
Map<String,Object> |
getSnapshot(RedactionUtils.RedactionContext ctx)
Create a snapshot of all content in this instance.
|
boolean |
hasData(String path) |
List<String> |
listData(String path) |
List<String> |
listData(String path,
org.apache.zookeeper.Watcher watcher) |
List<String> |
listTree(String path) |
void |
makePath(String path) |
void |
makePath(String path,
byte[] data,
org.apache.zookeeper.CreateMode createMode,
boolean failOnExists) |
List<org.apache.zookeeper.OpResult> |
multi(Iterable<org.apache.zookeeper.Op> ops) |
void |
removeData(String path,
int version) |
void |
setData(String path,
byte[] data,
int version) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAutoScalingConfig, getData, removeRecursivelyisClosedpublic SnapshotDistribStateManager(DistribStateManager other, AutoScalingConfig config) throws Exception
DistribStateManager instance.other - another instanceconfig - optional AutoScalingConfig, which will overwrite any existing config.Exceptionpublic SnapshotDistribStateManager(Map<String,Object> snapshot)
snapshot - previous snapshot created using this class.public SnapshotDistribStateManager(Map<String,Object> snapshot, AutoScalingConfig config)
snapshot - previous snapshot created using this class.config - optional config to override the one from snapshot, may be nullpublic Map<String,Object> getSnapshot(RedactionUtils.RedactionContext ctx)
public boolean hasData(String path) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException
hasData in interface DistribStateManagerIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic List<String> listData(String path) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
listData in interface DistribStateManagerNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic List<String> listTree(String path)
listTree in interface DistribStateManagerpublic List<String> listData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
listData in interface DistribStateManagerNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic VersionedData getData(String path, org.apache.zookeeper.Watcher watcher) throws NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
getData in interface DistribStateManagerNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void makePath(String path) throws AlreadyExistsException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
makePath in interface DistribStateManagerAlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic 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, IOException, org.apache.zookeeper.KeeperException, InterruptedException
createData in interface DistribStateManagerAlreadyExistsExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic void removeData(String path, int version) throws NoSuchElementException, IOException, NotEmptyException, org.apache.zookeeper.KeeperException, InterruptedException, BadVersionException
removeData in interface DistribStateManagerNoSuchElementExceptionIOExceptionNotEmptyExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionBadVersionExceptionpublic void setData(String path, byte[] data, int version) throws BadVersionException, NoSuchElementException, IOException, org.apache.zookeeper.KeeperException, InterruptedException
setData in interface DistribStateManagerBadVersionExceptionNoSuchElementExceptionIOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionpublic 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 close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.