Package io.camunda.zeebe.snapshots.impl
Class FileBasedTransientSnapshot
java.lang.Object
io.camunda.zeebe.snapshots.impl.FileBasedTransientSnapshot
- All Implemented Interfaces:
PersistableSnapshot,TransientSnapshot
Represents a pending snapshot, that is a snapshot in the process of being written and has not yet
been committed to the store.
-
Method Summary
Modifier and TypeMethodDescriptionabort()Aborts the not yet persisted snapshot and removes all related data.getPath()Returns the pending snapshot's path.persist()Persists the snapshot with all his data and returns the representation of this snapshot.Takes a snapshot on the given path.toString()withLastFollowupEventPosition(long lastFollowupEventPosition) A snapshot is only valid if the accompanying logstream has events from processedPosition up to the last followup event position.
-
Method Details
-
take
Description copied from interface:TransientSnapshotTakes a snapshot on the given path. This can be persisted later via callingPersistableSnapshot.persist(). Based on the implementation this could mean that this is writen before on a temporary folder and then moved to the valid snapshot directory.- Specified by:
takein interfaceTransientSnapshot- Parameters:
takeSnapshot- the predicate which should take the snapshot and should return true on success- Returns:
- true on success, false otherwise
-
withLastFollowupEventPosition
Description copied from interface:TransientSnapshotA snapshot is only valid if the accompanying logstream has events from processedPosition up to the last followup event position. The last followUp event position is the position of an event whose source position >= actual processed position in the state.- Specified by:
withLastFollowupEventPositionin interfaceTransientSnapshot- Parameters:
lastFollowupEventPosition- position of the followup event which must be in the logstream to ensure that the system can recover from the snapshot and the events in the logstream.- Returns:
- transient snapshot.
-
abort
Description copied from interface:PersistableSnapshotAborts the not yet persisted snapshot and removes all related data.- Specified by:
abortin interfacePersistableSnapshot- Returns:
- a future which will be completed when the abort is done.
-
persist
Description copied from interface:PersistableSnapshotPersists the snapshot with all his data and returns the representation of this snapshot.- Specified by:
persistin interfacePersistableSnapshot- Returns:
- a future that will be completed with the persisted snapshot
-
snapshotId
- Specified by:
snapshotIdin interfacePersistableSnapshot- Returns:
- the snapshotId of the snapshot
-
getPath
Description copied from interface:PersistableSnapshotReturns the pending snapshot's path.- Specified by:
getPathin interfacePersistableSnapshot- Returns:
- the path of the pending snapshot
-
toString
-