Class FileBasedSnapshot

java.lang.Object
io.camunda.zeebe.snapshots.impl.FileBasedSnapshot
All Implemented Interfaces:
PersistedSnapshot

public final class FileBasedSnapshot extends Object implements PersistedSnapshot
  • Method Details

    • getSnapshotId

      public FileBasedSnapshotId getSnapshotId()
    • getDirectory

      public Path getDirectory()
    • version

      public int version()
      Description copied from interface: PersistedSnapshot
      Returns the snapshot format version.
      Specified by:
      version in interface PersistedSnapshot
      Returns:
      the snapshot format version
    • getIndex

      public long getIndex()
      Description copied from interface: PersistedSnapshot
      Returns the snapshot index.

      The snapshot index is the index of the state machine at the point at which the snapshot was persisted.

      Specified by:
      getIndex in interface PersistedSnapshot
      Returns:
      The snapshot index.
    • getTerm

      public long getTerm()
      Description copied from interface: PersistedSnapshot
      Returns the snapshot term.

      The snapshot term is the term of the state machine at the point at which the snapshot was persisted.

      Specified by:
      getTerm in interface PersistedSnapshot
      Returns:
      The snapshot term.
    • newChunkReader

      public SnapshotChunkReader newChunkReader()
      Description copied from interface: PersistedSnapshot
      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.
      Specified by:
      newChunkReader in interface PersistedSnapshot
      Returns:
      a new snapshot chunk reader
    • getPath

      public Path getPath()
      Specified by:
      getPath in interface PersistedSnapshot
      Returns:
      a path to the snapshot location
    • getChecksumPath

      public Path getChecksumPath()
      Specified by:
      getChecksumPath in interface PersistedSnapshot
      Returns:
      path to checksum file
    • getCompactionBound

      public long getCompactionBound()
      Description copied from interface: PersistedSnapshot
      Returns an implementation specific compaction bound, e.g. a log stream position, index etc., used during compaction
      Specified by:
      getCompactionBound in interface PersistedSnapshot
      Returns:
      the compaction upper bound
    • getId

      public String getId()
      Specified by:
      getId in interface PersistedSnapshot
      Returns:
      the identifier of the snapshot
    • getChecksums

      public ImmutableChecksumsSFV getChecksums()
      Description copied from interface: PersistedSnapshot
      Returns the checksums of the snapshot files, which can be used to verify integrity.
      Specified by:
      getChecksums in interface PersistedSnapshot
      Returns:
      the checksum of the snapshot files
    • getMetadata

      public SnapshotMetadata getMetadata()
      Description copied from interface: PersistedSnapshot
      SnapshotMetadata includes information related to a snapshot.
      Specified by:
      getMetadata in interface PersistedSnapshot
      Returns:
      the metadata of the snapshot.
    • reserve

      public ActorFuture<SnapshotReservation> reserve()
      Description copied from interface: PersistedSnapshot
      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()

      Specified by:
      reserve in interface PersistedSnapshot
      Returns:
      future with SnapshotReservation
    • isReserved

      public boolean isReserved()
      Specified by:
      isReserved in interface PersistedSnapshot
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object