public class ReplicatedLockTokenStateMachine extends Object implements StateMachine<ReplicatedLockTokenRequest>
ReplicatedLockTokenRequest. Keeps track of the current holder of the replicated token,
which is identified by a monotonically increasing id, and an owning member.| Constructor and Description |
|---|
ReplicatedLockTokenStateMachine(StateStorage<ReplicatedLockTokenState> storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyCommand(ReplicatedLockTokenRequest tokenRequest,
long commandIndex,
Consumer<Result> callback)
Apply command to state machine, modifying its internal state.
|
ReplicatedLockTokenRequest |
currentToken() |
void |
flush()
Flushes state to durable storage.
|
void |
installSnapshot(ReplicatedLockTokenState snapshot) |
long |
lastAppliedIndex()
Return the index of the last applied command by this state machine.
|
ReplicatedLockTokenState |
snapshot() |
public ReplicatedLockTokenStateMachine(StateStorage<ReplicatedLockTokenState> storage)
public void applyCommand(ReplicatedLockTokenRequest tokenRequest, long commandIndex, Consumer<Result> callback)
StateMachineapplyCommand in interface StateMachine<ReplicatedLockTokenRequest>tokenRequest - Command to the state machine.commandIndex - The index of the command.callback - To be called when a result is produced.public void flush()
throws IOException
StateMachineflush in interface StateMachine<ReplicatedLockTokenRequest>IOExceptionpublic long lastAppliedIndex()
StateMachinelastAppliedIndex in interface StateMachine<ReplicatedLockTokenRequest>public ReplicatedLockTokenState snapshot()
public void installSnapshot(ReplicatedLockTokenState snapshot)
public ReplicatedLockTokenRequest currentToken()
Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.