public interface SnapshotState
Modifier and Type | Method and Description |
---|---|
void |
apply(ApplySnapshot snapshot)
Applies a snapshot on a follower that was installed by the leader.
|
boolean |
capture(ReplicatedLogEntry lastLogEntry,
long replicatedToAllIndex)
Initiates a capture snapshot.
|
boolean |
captureToInstall(ReplicatedLogEntry lastLogEntry,
long replicatedToAllIndex,
String targetFollower)
Initiates a capture snapshot for the purposing of installing the snapshot on a follower.
|
void |
commit(long sequenceNumber,
long timeStamp)
Commit the snapshot by trimming the log.
|
boolean |
isCapturing()
Returns whether or not a capture is in progress.
|
void |
persist(Snapshot.State snapshotState,
Optional<OutputStream> installSnapshotStream,
long totalMemory)
Persists a snapshot.
|
void |
rollback()
Rolls back the snapshot on failure.
|
long |
trimLog(long desiredTrimIndex)
Trims the in-memory log.
|
boolean isCapturing()
boolean capture(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex)
lastLogEntry
- the last entry in the replicated logreplicatedToAllIndex
- the current replicatedToAllIndexboolean captureToInstall(ReplicatedLogEntry lastLogEntry, long replicatedToAllIndex, String targetFollower)
lastLogEntry
- the last entry in the replicated logreplicatedToAllIndex
- the current replicatedToAllIndextargetFollower
- the id of the follower on which to installvoid apply(ApplySnapshot snapshot)
snapshot
- the Snapshot to apply.void persist(Snapshot.State snapshotState, Optional<OutputStream> installSnapshotStream, long totalMemory)
snapshotState
- the snapshot StateinstallSnapshotStream
- Optional OutputStream that is present if the snapshot is to also be installed
on a follower.totalMemory
- the total memory thresholdvoid commit(long sequenceNumber, long timeStamp)
sequenceNumber
- the sequence number of the persisted snapshottimeStamp
- the time stamp of the persisted snapshotvoid rollback()
long trimLog(long desiredTrimIndex)
desiredTrimIndex
- the desired index to trim fromCopyright © 2019 OpenDaylight. All rights reserved.