Class SnapshotManager
java.lang.Object
org.opendaylight.controller.cluster.raft.SnapshotManager
Manages the capturing of snapshots for a RaftActor.
- Author:
- Moiz Raja, Thomas Pantelis
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordInternal message, issued by follower behavior to its actor, eventually routed toSnapshotManager.static final class -
Method Summary
Modifier and TypeMethodDescriptionbooleanInitiates a capture snapshot.booleancaptureToInstall(EntryMeta lastLogEntry, long replicatedToAllIndex, String targetFollower) Initiates a capture snapshot for the purposing of installing the snapshot on a follower.@Nullable SnapshotManager.CaptureSnapshotbooleanbooleanReturns whether or not a capture is in progress.voidpersist(Snapshot.State snapshotState, InstallableSnapshot installable) Persists a snapshot.voidsetSnapshotCohort(RaftActorSnapshotCohort<?> snapshotCohort) longtrimLog(long desiredTrimIndex) Trims the in-memory log.
-
Method Details
-
isApplying
public boolean isApplying() -
isCapturing
public boolean isCapturing()Returns whether or not a capture is in progress.- Returns:
- true when a snapshot is being captured, false otherwise
-
captureToInstall
public boolean captureToInstall(EntryMeta lastLogEntry, long replicatedToAllIndex, String targetFollower) Initiates a capture snapshot for the purposing of installing the snapshot on a follower.- Parameters:
lastLogEntry- the last entry in the replicated logreplicatedToAllIndex- the current replicatedToAllIndextargetFollower- the id of the follower on which to install- Returns:
- true if capture was started
-
capture
Initiates a capture snapshot.- Parameters:
lastLogEntry- the last entry in the replicated logreplicatedToAllIndex- the current replicatedToAllIndex- Returns:
- true if capture was started
-
persist
@NonNullByDefault public void persist(Snapshot.State snapshotState, InstallableSnapshot installable) Persists a snapshot.- Parameters:
snapshotState- the snapshot Stateinstallable- theInstallableSnapshot
-
trimLog
public long trimLog(long desiredTrimIndex) Trims the in-memory log.- Parameters:
desiredTrimIndex- the desired index to trim from- Returns:
- the actual trim index
-
setSnapshotCohort
-
getCaptureSnapshot
-