Interface JournalIndex

All Known Implementing Classes:
SparseJournalIndex

public interface JournalIndex
Index of a particular JournalSegment.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Position
    index(long index, int position)
    Adds an entry for the given index at the given position.
    @Nullable Position
    Return the last position known to this index.
    @Nullable Position
    lookup(long index)
    Looks up the position of the given index.
    @Nullable Position
    truncate(long index)
    Truncates the index to the given index and returns its position, if available.
  • Method Details

    • index

      @NonNull Position index(long index, int position)
      Adds an entry for the given index at the given position.
      Parameters:
      index - the index for which to add the entry
      position - 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

      @Nullable Position lookup(long index)
      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

      @Nullable Position truncate(long index)
      Truncates the index to the given index and returns its position, if available.
      Parameters:
      index - the index to which to truncate the index, or null
      Returns:
      the position of the given index or a lesser index, or null