public interface FSMCaller extends Lifecycle<FSMCallerOptions>, Describer
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
FSMCaller.LastAppliedLogIndexListener
Listen on lastAppliedLogIndex update events.
|
Describer.DefaultPrinter, Describer.Printer| 限定符和类型 | 方法和说明 |
|---|---|
void |
addLastAppliedLogIndexListener(FSMCaller.LastAppliedLogIndexListener listener)
Adds a LastAppliedLogIndexListener.
|
long |
getLastAppliedIndex()
Returns the last log entry index to apply state machine.
|
void |
join()
Called after shutdown to wait it terminates.
|
boolean |
onCommitted(long committedIndex)
Called when log entry committed
|
boolean |
onError(RaftException error)
Called when error happens.
|
boolean |
onLeaderStart(long term)
Called when the leader starts.
|
boolean |
onLeaderStop(Status status)
Called when the leader stops.
|
boolean |
onSnapshotLoad(LoadSnapshotClosure done)
Called after loading snapshot.
|
boolean |
onSnapshotSave(SaveSnapshotClosure done)
Called after saving snapshot.
|
boolean |
onStartFollowing(LeaderChangeContext ctx)
Called when start following a leader.
|
boolean |
onStopFollowing(LeaderChangeContext ctx)
Called when stop following a leader.
|
void addLastAppliedLogIndexListener(FSMCaller.LastAppliedLogIndexListener listener)
boolean onCommitted(long committedIndex)
committedIndex - committed log indexboolean onSnapshotLoad(LoadSnapshotClosure done)
done - callbackboolean onSnapshotSave(SaveSnapshotClosure done)
done - callbackboolean onLeaderStop(Status status)
status - status infoboolean onLeaderStart(long term)
term - current termboolean onStartFollowing(LeaderChangeContext ctx)
ctx - context of leader changeboolean onStopFollowing(LeaderChangeContext ctx)
ctx - context of leader changeboolean onError(RaftException error)
error - error infolong getLastAppliedIndex()
void join() throws InterruptedException
InterruptedException - if the current thread is interrupted
while waitingCopyright © 2021. All rights reserved.