Class JournalWriteTask

java.lang.Object
org.opendaylight.controller.cluster.raft.spi.JournalWriteTask
All Implemented Interfaces:
Runnable

@NonNullByDefault public final class JournalWriteTask extends Object implements Runnable
  • Constructor Details

  • Method Details

    • journal

      @Beta public EntryJournal journal()
    • appendEntry

      public void appendEntry(LogEntry entry, RaftCallback<Long> callback) throws InterruptedException
      Append a log entry to the journal.
      Parameters:
      entry - the entry to append
      callback - the callback to invoke
      Throws:
      InterruptedException - if interrupted while waiting
    • discardHead

      public void discardHead(long firstRetainedIndex) throws InterruptedException
      Discard entries from the head of the journal.
      Parameters:
      firstRetainedIndex - the index of the first entry to retain
      Throws:
      InterruptedException - if interrupted while waiting
    • syncDiscardTail

      public void syncDiscardTail(long firstRemovedIndex) throws InterruptedException
      Discard entries from the head of the journal. The callback is guaranteed to be invoked before any another message is processed,
      Parameters:
      firstRemovedIndex - the journal index of the first entry to remove
      Throws:
      InterruptedException - if interrupted while waiting
    • setApplyTo

      public void setApplyTo(long journalIndex) throws InterruptedException
      Throws:
      InterruptedException
    • cancelAndTerminate

      public void cancelAndTerminate()
    • processAndTerminate

      public EntryJournal processAndTerminate()
    • run

      public void run()
      Specified by:
      run in interface Runnable