Package io.camunda.zeebe.snapshots.impl
Class FileBasedSnapshot
java.lang.Object
io.camunda.zeebe.snapshots.impl.FileBasedSnapshot
- All Implemented Interfaces:
PersistedSnapshot
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns 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.inthashCode()booleanReturns a new snapshot chunk reader for this snapshot.reserve()Reserves this snapshot.toString()intversion()Returns the snapshot format version.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.snapshots.PersistedSnapshot
files, isBootstrap
-
Method Details
-
getSnapshotId
-
getDirectory
-
version
public int version()Description copied from interface:PersistedSnapshotReturns the snapshot format version.- Specified by:
versionin interfacePersistedSnapshot- Returns:
- the snapshot format version
-
snapshotId
- Specified by:
snapshotIdin interfacePersistedSnapshot
-
getIndex
public long getIndex()Description copied from interface:PersistedSnapshotReturns the snapshot index.The snapshot index is the index of the state machine at the point at which the snapshot was persisted.
- Specified by:
getIndexin interfacePersistedSnapshot- Returns:
- The snapshot index.
-
getTerm
public long getTerm()Description copied from interface:PersistedSnapshotReturns the snapshot term.The snapshot term is the term of the state machine at the point at which the snapshot was persisted.
- Specified by:
getTermin interfacePersistedSnapshot- Returns:
- The snapshot term.
-
newChunkReader
Description copied from interface:PersistedSnapshotReturns 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.- Specified by:
newChunkReaderin interfacePersistedSnapshot- Returns:
- a new snapshot chunk reader
-
getPath
- Specified by:
getPathin interfacePersistedSnapshot- Returns:
- a path to the snapshot location
-
getChecksumPath
- Specified by:
getChecksumPathin interfacePersistedSnapshot- Returns:
- path to checksum file
-
getCompactionBound
public long getCompactionBound()Description copied from interface:PersistedSnapshotReturns an implementation specific compaction bound, e.g. a log stream position, index etc., used during compaction- Specified by:
getCompactionBoundin interfacePersistedSnapshot- Returns:
- the compaction upper bound
-
getId
- Specified by:
getIdin interfacePersistedSnapshot- Returns:
- the identifier of the snapshot
-
getChecksums
Description copied from interface:PersistedSnapshotReturns the checksums of the snapshot files, which can be used to verify integrity.- Specified by:
getChecksumsin interfacePersistedSnapshot- Returns:
- the checksum of the snapshot files
-
getMetadata
Description copied from interface:PersistedSnapshotSnapshotMetadata includes information related to a snapshot.- Specified by:
getMetadatain interfacePersistedSnapshot- Returns:
- the metadata of the snapshot.
-
reserve
Description copied from interface:PersistedSnapshotReserves 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()- Specified by:
reservein interfacePersistedSnapshot- Returns:
- future with SnapshotReservation
-
isReserved
public boolean isReserved()- Specified by:
isReservedin interfacePersistedSnapshot
-
hashCode
public int hashCode() -
equals
-
toString
-