Class SegmentedByteBufJournal

java.lang.Object
io.atomix.storage.journal.SegmentedByteBufJournal
All Implemented Interfaces:
AutoCloseable, org.opendaylight.controller.raft.journal.RaftJournal

public final class SegmentedByteBufJournal extends Object implements org.opendaylight.controller.raft.journal.RaftJournal
A RaftJournal Implementation.
  • Method Details

    • size

      public long size()
      Returns the total size of the journal.
      Returns:
      the total size of the journal
    • firstIndex

      public long firstIndex()
      Specified by:
      firstIndex in interface org.opendaylight.controller.raft.journal.RaftJournal
    • lastIndex

      public long lastIndex()
      Specified by:
      lastIndex in interface org.opendaylight.controller.raft.journal.RaftJournal
    • writer

      public org.opendaylight.controller.raft.journal.EntryWriter writer()
      Specified by:
      writer in interface org.opendaylight.controller.raft.journal.RaftJournal
    • openReader

      public org.opendaylight.controller.raft.journal.EntryReader openReader(long index)
      Specified by:
      openReader in interface org.opendaylight.controller.raft.journal.RaftJournal
    • openCommitsReader

      public org.opendaylight.controller.raft.journal.EntryReader openCommitsReader(long index)
      Specified by:
      openCommitsReader in interface org.opendaylight.controller.raft.journal.RaftJournal
    • isCompactable

      public boolean isCompactable(long index)
      Returns a boolean indicating whether a segment can be removed from the journal prior to the given index.
      Parameters:
      index - the index from which to remove segments
      Returns:
      indicates whether a segment can be removed from the journal
    • getCompactableIndex

      public long getCompactableIndex(long index)
      Returns the index of the last segment in the log.
      Parameters:
      index - the compaction index
      Returns:
      the starting index of the last segment in the log
    • compact

      public void compact(long index)
      Specified by:
      compact in interface org.opendaylight.controller.raft.journal.RaftJournal
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.opendaylight.controller.raft.journal.RaftJournal
    • builder

      public static SegmentedByteBufJournal.Builder builder()