| 限定符和类型 | 类和说明 |
|---|---|
class |
FSMCallerImpl.OnErrorClosure
Closure runs with an error.
|
FSMCaller.LastAppliedLogIndexListenerDescriber.DefaultPrinter, Describer.Printer| 构造器和说明 |
|---|
FSMCallerImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addLastAppliedLogIndexListener(FSMCaller.LastAppliedLogIndexListener listener)
Adds a LastAppliedLogIndexListener.
|
void |
describe(Describer.Printer out) |
long |
getLastAppliedIndex()
Returns the last log entry index to apply state machine.
|
boolean |
init(FSMCallerOptions opts)
Initialize the service.
|
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 |
shutdown()
Dispose the resources for service.
|
String |
toString() |
public boolean init(FSMCallerOptions opts)
Lifecycleinit 在接口中 Lifecycle<FSMCallerOptions>public void shutdown()
Lifecycleshutdown 在接口中 Lifecycle<FSMCallerOptions>public void addLastAppliedLogIndexListener(FSMCaller.LastAppliedLogIndexListener listener)
FSMCalleraddLastAppliedLogIndexListener 在接口中 FSMCallerpublic boolean onCommitted(long committedIndex)
FSMCalleronCommitted 在接口中 FSMCallercommittedIndex - committed log indexpublic boolean onSnapshotLoad(LoadSnapshotClosure done)
FSMCalleronSnapshotLoad 在接口中 FSMCallerdone - callbackpublic boolean onSnapshotSave(SaveSnapshotClosure done)
FSMCalleronSnapshotSave 在接口中 FSMCallerdone - callbackpublic boolean onLeaderStop(Status status)
FSMCalleronLeaderStop 在接口中 FSMCallerstatus - status infopublic boolean onLeaderStart(long term)
FSMCalleronLeaderStart 在接口中 FSMCallerterm - current termpublic boolean onStartFollowing(LeaderChangeContext ctx)
FSMCalleronStartFollowing 在接口中 FSMCallerctx - context of leader changepublic boolean onStopFollowing(LeaderChangeContext ctx)
FSMCalleronStopFollowing 在接口中 FSMCallerctx - context of leader changepublic boolean onError(RaftException error)
FSMCallerpublic long getLastAppliedIndex()
FSMCallergetLastAppliedIndex 在接口中 FSMCallerpublic void join()
throws InterruptedException
FSMCallerjoin 在接口中 FSMCallerInterruptedException - if the current thread is interrupted
while waitingpublic void describe(Describer.Printer out)
Copyright © 2021. All rights reserved.