public abstract class RaftStateMachine
extends java.lang.Object
| Constructor and Description |
|---|
RaftStateMachine() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
applyTransition(byte[] transition,
long now,
java.util.concurrent.ExecutorService pool)
The custom implementation of applying a transition
|
java.lang.String |
debugTransition(byte[] transition)
This is used for debugging log entries.
|
java.util.Set<java.lang.String> |
getHospice()
Get the current hospice.
|
void |
overwriteWithSerialized(byte[] serialized,
long now,
java.util.concurrent.ExecutorService pool)
This overwrites the current state of the state machine with a serialized proto.
|
protected abstract void |
overwriteWithSerializedImpl(byte[] serialized,
long now,
java.util.concurrent.ExecutorService pool)
This overwrites the current state of the state machine with a serialized proto.
|
java.util.Set<java.lang.String> |
owners()
The set of nodes that own anything in the state machine.
|
byte[] |
serialize()
This serializes the state machine's current state into a proto that can be read from overwriteWithSerialized().
|
protected abstract com.google.protobuf.ByteString |
serializeImpl()
This serializes the state machine's current state into a proto that can be read from overwriteWithSerialized().
|
public final java.util.Set<java.lang.String> getHospice()
protected abstract com.google.protobuf.ByteString serializeImpl()
public final byte[] serialize()
protected abstract void overwriteWithSerializedImpl(byte[] serialized,
long now,
java.util.concurrent.ExecutorService pool)
serialized - the state machine to overwrite this one with, in serialized formnow - the current time, in epoch millis.pool - an executor pool to run lock future commits on.public final void overwriteWithSerialized(byte[] serialized,
long now,
java.util.concurrent.ExecutorService pool)
serialized - the state machine to overwrite this one with, in serialized formnow - the current time, in epoch millis.pool - an executor pool to run lock future commits on.protected abstract void applyTransition(byte[] transition,
long now,
java.util.concurrent.ExecutorService pool)
public java.lang.String debugTransition(byte[] transition)
transition - the transition to debugpublic java.util.Set<java.lang.String> owners()