Interface PersistedSnapshotStore

All Superinterfaces:
AutoCloseable, BootstrapSnapshotStore, CloseableSilently
All Known Subinterfaces:
ConstructableSnapshotStore, ReceivableSnapshotStore
All Known Implementing Classes:
FileBasedSnapshotStore

public interface PersistedSnapshotStore extends CloseableSilently, BootstrapSnapshotStore
Represents a store, which allows to persist snapshots on a storage, which is implementation dependent. It can receive SnapshotChunk's from an already PersistedSnapshot and persist them in this current store.

Only one PersistedSnapshot at a time is stored in the PersistedSnapshotStore and can be received via getLatestSnapshot().

  • Method Details

    • hasSnapshotId

      boolean hasSnapshotId(String id)
      Returns true if the given identifier is equal to the snapshot id of the current persisted snapshot, false otherwise.
      Parameters:
      id - the snapshot Id to look for
      Returns:
      true if the current snapshot has the equal Id, false otherwise
      See Also:
    • getLatestSnapshot

      Optional<PersistedSnapshot> getLatestSnapshot()
      Returns:
      the latest PersistedSnapshot if exists
    • getAvailableSnapshots

      ActorFuture<Set<PersistedSnapshot>> getAvailableSnapshots()
      Returns a set of all available snapshots.
    • getCompactionBound

      ActorFuture<Long> getCompactionBound()
      Returns the lowest compaction bound of all available snapshots.
    • abortPendingSnapshots

      ActorFuture<Void> abortPendingSnapshots()
      Purges all ongoing pending/transient/volatile snapshots.
      Returns:
      future which will be completed when all pending snapshots are deleted
    • addSnapshotListener

      ActorFuture<Boolean> addSnapshotListener(PersistedSnapshotListener listener)
      Adds an PersistedSnapshotListener to the store, which is notified when a new PersistedSnapshot is persisted at this store.
      Parameters:
      listener - the listener which should be added and notified later
    • removeSnapshotListener

      ActorFuture<Boolean> removeSnapshotListener(PersistedSnapshotListener listener)
      Removes an registered PersistedSnapshotListener from the store. The listener will no longer called when a new PersistedSnapshot is persisted at this store.
      Parameters:
      listener - the listener which should be removed
    • getCurrentSnapshotIndex

      long getCurrentSnapshotIndex()
      Returns:
      the snapshot index of the latest PersistedSnapshot
      See Also:
    • delete

      ActorFuture<Void> delete()
      Deletes a PersistedSnapshotStore from disk.

      The snapshot store will be deleted by simply reading snapshot file names from disk and deleting snapshot files directly. Deleting the snapshot store does not involve reading any snapshot files into memory.

    • getPath

      Path getPath()