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 |
onError(DLedgerException error)
Once a critical error occurs, disallow any task enter the Dledger node
until the error has been fixed and restart it.
|
void |
onShutdown()
Invoked once when the raft node was shut down.
|
boolean |
onSnapshotLoad(SnapshotReader reader)
User defined snapshot load function.
|
boolean |
onSnapshotSave(SnapshotWriter writer)
User defined snapshot generate function.
|
void onApply(CommittedEntryIterator iter)
iter - iterator of committed entryboolean onSnapshotSave(SnapshotWriter writer)
writer - snapshot writerboolean onSnapshotLoad(SnapshotReader reader)
reader - snapshot readervoid onShutdown()
void onError(DLedgerException error)
error - DLedger error messagedefault String generateDLedgerId(String dLedgerGroupId, String dLedgerSelfId)
dLedgerGroupId - the group id of the DLedgerServerdLedgerSelfId - the self id of the DLedgerServerString getBindDLedgerId()
Copyright © 2022. All rights reserved.