public interface StateMachine
| 限定符和类型 | 方法和说明 |
|---|---|
default java.lang.String |
generateDLedgerId(java.lang.String dLedgerGroupId,
java.lang.String dLedgerSelfId)
User must create DLedgerId by this method, it will generate the DLedgerId with format like that: 'dLedgerGroupId#dLedgerSelfId'
|
java.lang.String |
getBindDLedgerId()
User should return the DLedgerId which can be created by the method 'StateMachine#generateDLedgerId'
|
void |
onApply(CommittedEntryIterator iter)
Update the user statemachine with a batch a tasks that can be accessed
through |iterator|.
|
void |
onShutdown()
Invoked once when the raft node was shut down.
|
boolean |
onSnapshotLoad(SnapshotReader reader)
User defined snapshot load function.
|
void |
onSnapshotSave(SnapshotWriter writer,
java.util.concurrent.CompletableFuture<java.lang.Boolean> done)
User defined snapshot generate function, this method will block StateMachine#onApply(Iterator).
|
void onApply(CommittedEntryIterator iter)
iter - iterator of committed entryvoid onSnapshotSave(SnapshotWriter writer, java.util.concurrent.CompletableFuture<java.lang.Boolean> done)
writer - snapshot writerdone - callbackboolean onSnapshotLoad(SnapshotReader reader)
reader - snapshot readervoid onShutdown()
default java.lang.String generateDLedgerId(java.lang.String dLedgerGroupId,
java.lang.String dLedgerSelfId)
dLedgerGroupId - the group id of the DLedgerServerdLedgerSelfId - the self id of the DLedgerServerjava.lang.String getBindDLedgerId()
Copyright © 2022. All Rights Reserved.