Package io.atomix.storage.journal.index
Class SparseJournalIndex
java.lang.Object
io.atomix.storage.journal.index.SparseJournalIndex
- All Implemented Interfaces:
JournalIndex
A
JournalIndex maintaining target density.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionindex(long index, int position) Adds an entry for the given index at the given position.last()Return the last position known to this index.lookup(long index) Looks up the position of the given index.toString()truncate(long index) Truncates the index to the given index and returns its position, if available.
-
Constructor Details
-
SparseJournalIndex
public SparseJournalIndex() -
SparseJournalIndex
public SparseJournalIndex(double density)
-
-
Method Details
-
index
Description copied from interface:JournalIndexAdds an entry for the given index at the given position.- Specified by:
indexin interfaceJournalIndex- Parameters:
index- the index for which to add the entryposition- the position of the given index- Returns:
- A
Position
-
last
Description copied from interface:JournalIndexReturn the last position known to this index.- Specified by:
lastin interfaceJournalIndex- Returns:
- the last position known to this index
-
lookup
Description copied from interface:JournalIndexLooks up the position of the given index.- Specified by:
lookupin interfaceJournalIndex- Parameters:
index- the index to lookup- Returns:
- the position of the given index or a lesser index, or
null
-
truncate
Description copied from interface:JournalIndexTruncates the index to the given index and returns its position, if available.- Specified by:
truncatein interfaceJournalIndex- Parameters:
index- the index to which to truncate the index, ornull- Returns:
- the position of the given index or a lesser index, or
null
-
toString
-