public interface StateMachine
| Modifier and Type | Method and Description |
|---|---|
default String |
generateDLedgerId(String dLedgerGroupId,
String dLedgerSelfId)
User must create DLedgerId by this method, it will generate the DLedgerId with format like that: 'dLedgerGroupId#dLedgerSelfId'
|
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,
CompletableFuture<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, CompletableFuture<Boolean> done)
writer - snapshot writerdone - callbackboolean onSnapshotLoad(SnapshotReader reader)
reader - snapshot readervoid onShutdown()
default String generateDLedgerId(String dLedgerGroupId, String dLedgerSelfId)
dLedgerGroupId - the group id of the DLedgerServerdLedgerSelfId - the self id of the DLedgerServerString getBindDLedgerId()
Copyright © 2023. All rights reserved.