Package io.camunda.zeebe.snapshots
Interface PersistedSnapshot
- All Known Implementing Classes:
FileBasedSnapshot
public interface PersistedSnapshot
Represents a snapshot, which was persisted at the
PersistedSnapshotStore.-
Method Summary
Modifier and TypeMethodDescriptionReturns the checksums of the snapshot files, which can be used to verify integrity.longReturns an implementation specific compaction bound, e.g. a log stream position, index etc., used during compactiongetId()longgetIndex()Returns the snapshot index.SnapshotMetadata includes information related to a snapshot.getPath()longgetTerm()Returns the snapshot term.booleanReturns a new snapshot chunk reader for this snapshot.reserve()Reserves this snapshot.intversion()Returns the snapshot format version.
-
Method Details
-
version
int version()Returns the snapshot format version.- Returns:
- the snapshot format version
-
getIndex
long getIndex()Returns the snapshot index.The snapshot index is the index of the state machine at the point at which the snapshot was persisted.
- Returns:
- The snapshot index.
-
getTerm
long getTerm()Returns the snapshot term.The snapshot term is the term of the state machine at the point at which the snapshot was persisted.
- Returns:
- The snapshot term.
-
newChunkReader
SnapshotChunkReader newChunkReader()Returns a new snapshot chunk reader for this snapshot. Chunk readers are meant to be one-time use and as such don't have to be thread-safe.- Returns:
- a new snapshot chunk reader
-
getPath
Path getPath()- Returns:
- a path to the snapshot location
-
getChecksumPath
Path getChecksumPath()- Returns:
- path to checksum file
-
getCompactionBound
long getCompactionBound()Returns an implementation specific compaction bound, e.g. a log stream position, index etc., used during compaction- Returns:
- the compaction upper bound
-
getId
String getId()- Returns:
- the identifier of the snapshot
-
getChecksums
ImmutableChecksumsSFV getChecksums()Returns the checksums of the snapshot files, which can be used to verify integrity.- Returns:
- the checksum of the snapshot files
-
getMetadata
SnapshotMetadata getMetadata()SnapshotMetadata includes information related to a snapshot.- Returns:
- the metadata of the snapshot.
-
reserve
ActorFuture<SnapshotReservation> reserve()Reserves this snapshot. When the snapshot is reserved, it is not deleted until it is released. The reservation status is not persisted. After a restart the snapshot will be in state released.Returns a SnapshotReservation if the snapshot exists and is successfully reserved. Fails exceptionally if the snapshot does not exist.
To release the reservation use
SnapshotReservation.release()- Returns:
- future with SnapshotReservation
-
isReserved
-