Package io.camunda.zeebe.snapshots
Interface SnapshotId
- All Superinterfaces:
Comparable<SnapshotId>
- All Known Implementing Classes:
FileBasedSnapshotId
Represents an identifier of an
PersistedSnapshot.-
Method Summary
Modifier and TypeMethodDescriptiondefault intcompareTo(SnapshotId other) A snapshot is considered "lower" if its term is less than that of the other snapshot.longlonggetIndex()longThe string representation of the snapshot identifier, looks like 'index-term-timestamp'.longgetTerm()
-
Method Details
-
getIndex
long getIndex()- Returns:
- the index of the snapshot
-
getTerm
long getTerm()- Returns:
- the term when the snapshot was taken
-
getProcessedPosition
long getProcessedPosition()- Returns:
- the processed position when the snapshot was taken
-
getExportedPosition
long getExportedPosition()- Returns:
- the exported position when the snapshot was taken
-
getSnapshotIdAsString
String getSnapshotIdAsString()The string representation of the snapshot identifier, looks like 'index-term-timestamp'.- Returns:
- the string representation
-
compareTo
A snapshot is considered "lower" if its term is less than that of the other snapshot. If they are the same, then it is considered "lower" if its index is less then the other, if they are equal then the processed positions are compared, and then exported positions are compared. If they are the same then these snapshots are the same order-wise.- Specified by:
compareToin interfaceComparable<SnapshotId>- Parameters:
other- the snapshot to compare against- Returns:
- -1 if
thisis less thanother, 0 if they are the same, 1 if it is greater
-