Interface RaftActorRecoveryCohort
-
public interface RaftActorRecoveryCohort
Interface for a class that participates in raft actor persistence recovery.- Author:
- Thomas Pantelis
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
appendRecoveredLogEntry(Payload data)
This method is called during recovery to append state data to the current batch.void
applyCurrentLogRecoveryBatch()
This method is called during recovery at the end of a batch to apply the current batched log entries.void
applyRecoverySnapshot(Snapshot.State snapshotState)
This method is called during recovery to reconstruct the state of the actor.@Nullable Snapshot
getRestoreFromSnapshot()
Returns the snapshot to restore from on recovery.void
startLogRecoveryBatch(int maxBatchSize)
This method is called during recovery at the start of a batch of state entries.
-
-
-
Method Detail
-
startLogRecoveryBatch
void startLogRecoveryBatch(int maxBatchSize)
This method is called during recovery at the start of a batch of state entries. Derived classes should perform any initialization needed to start a batch.- Parameters:
maxBatchSize
- the maximum batch size.
-
appendRecoveredLogEntry
void appendRecoveredLogEntry(Payload data)
This method is called during recovery to append state data to the current batch. This method is called 1 or more times afterstartLogRecoveryBatch(int)
.- Parameters:
data
- the state data
-
applyRecoverySnapshot
void applyRecoverySnapshot(Snapshot.State snapshotState)
This method is called during recovery to reconstruct the state of the actor.- Parameters:
snapshotState
- A snapshot of the state of the actor
-
applyCurrentLogRecoveryBatch
void applyCurrentLogRecoveryBatch()
This method is called during recovery at the end of a batch to apply the current batched log entries. This method is called afterappendRecoveredLogEntry(org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload)
.
-
getRestoreFromSnapshot
@Nullable Snapshot getRestoreFromSnapshot()
Returns the snapshot to restore from on recovery.- Returns:
- the snapshot or null if there's no snapshot to restore
-
-