public class ReplicatedIdAllocationStateMachine extends Object implements StateMachine<ReplicatedIdAllocationRequest>
| Constructor and Description |
|---|
ReplicatedIdAllocationStateMachine(StateStorage<IdAllocationState> storage) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyCommand(ReplicatedIdAllocationRequest request,
long commandIndex,
Consumer<Result> callback)
Apply command to state machine, modifying its internal state.
|
void |
flush()
Flushes state to durable storage.
|
void |
installSnapshot(IdAllocationState snapshot) |
long |
lastAppliedIndex()
Return the index of the last applied command by this state machine.
|
IdAllocationState |
snapshot() |
public ReplicatedIdAllocationStateMachine(StateStorage<IdAllocationState> storage)
public void applyCommand(ReplicatedIdAllocationRequest request, long commandIndex, Consumer<Result> callback)
StateMachineapplyCommand in interface StateMachine<ReplicatedIdAllocationRequest>request - 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<ReplicatedIdAllocationRequest>IOExceptionpublic long lastAppliedIndex()
StateMachinelastAppliedIndex in interface StateMachine<ReplicatedIdAllocationRequest>public IdAllocationState snapshot()
public void installSnapshot(IdAllocationState snapshot)
Copyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.