S
- the type of stateE
- the type of eventpublic class ZookeeperStateMachinePersist<S,E> extends java.lang.Object implements StateMachinePersist<S,E,org.apache.zookeeper.data.Stat>
StateMachinePersist
using zookeeper as a storage and
kroy libraries as a backing serialization technique.Constructor and Description |
---|
ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient,
java.lang.String path)
Instantiates a new zookeeper state machine persist.
|
ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient,
java.lang.String path,
java.lang.String logPath,
int logSize)
Instantiates a new zookeeper state machine persist.
|
Modifier and Type | Method and Description |
---|---|
StateMachineContext<S,E> |
read(org.apache.zookeeper.data.Stat stat)
Read a
StateMachineContext from a persistent store
with a context object T . |
StateMachineContext<S,E> |
readLog(int version,
org.apache.zookeeper.data.Stat stat) |
void |
write(StateMachineContext<S,E> context,
org.apache.zookeeper.data.Stat stat)
Write a
StateMachineContext into a persistent store
with a context object T . |
public ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient, java.lang.String path)
curatorClient
- the curator clientpath
- the path for persistent statepublic ZookeeperStateMachinePersist(org.apache.curator.framework.CuratorFramework curatorClient, java.lang.String path, java.lang.String logPath, int logSize)
curatorClient
- the curator clientpath
- the pathlogPath
- the log pathlogSize
- the log sizepublic void write(StateMachineContext<S,E> context, org.apache.zookeeper.data.Stat stat)
StateMachinePersist
StateMachineContext
into a persistent store
with a context object T
.write
in interface StateMachinePersist<S,E,org.apache.zookeeper.data.Stat>
context
- the contextstat
- the context ojbpublic StateMachineContext<S,E> read(org.apache.zookeeper.data.Stat stat) throws java.lang.Exception
StateMachinePersist
StateMachineContext
from a persistent store
with a context object T
.read
in interface StateMachinePersist<S,E,org.apache.zookeeper.data.Stat>
stat
- the context ojbjava.lang.Exception
- the exceptionpublic StateMachineContext<S,E> readLog(int version, org.apache.zookeeper.data.Stat stat) throws java.lang.Exception
java.lang.Exception