Package io.atomix.storage.journal.index
Interface JournalIndex
- All Known Implementing Classes:
SparseJournalIndex
public interface JournalIndex
Index of a particular JournalSegment.
-
Method Summary
Modifier and TypeMethodDescription@NonNull Positionindex(long index, int position) Adds an entry for the given index at the given position.@Nullable Positionlast()Return the last position known to this index.@Nullable Positionlookup(long index) Looks up the position of the given index.@Nullable Positiontruncate(long index) Truncates the index to the given index and returns its position, if available.
-
Method Details
-
index
Adds an entry for the given index at the given position.- Parameters:
index- the index for which to add the entryposition- the position of the given index- Returns:
- A
Position
-
last
@Nullable Position last()Return the last position known to this index.- Returns:
- the last position known to this index
-
lookup
Looks up the position of the given index.- Parameters:
index- the index to lookup- Returns:
- the position of the given index or a lesser index, or
null
-
truncate
Truncates the index to the given index and returns its position, if available.- Parameters:
index- the index to which to truncate the index, ornull- Returns:
- the position of the given index or a lesser index, or
null
-