Class JournalWriteTask
java.lang.Object
org.opendaylight.controller.cluster.raft.spi.JournalWriteTask
- All Implemented Interfaces:
Runnable
-
Constructor Summary
ConstructorsConstructorDescriptionJournalWriteTask(Ticker ticker, RaftStorageCompleter completer, EntryJournalV1 journal, int queueCapacity) JournalWriteTask(RaftStorageCompleter completer, EntryJournalV1 journal, int queueCapacity) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendEntry(LogEntry entry, RaftCallback<Long> callback) Append a log entry to the journal.voidvoiddiscardHead(long firstRetainedIndex) Discard entries from the head of the journal.journal()voidrun()voidsetApplyTo(long journalIndex) voidsyncDiscardTail(long firstRemovedIndex) Discard entries from the head of the journal.
-
Constructor Details
-
JournalWriteTask
-
JournalWriteTask
public JournalWriteTask(Ticker ticker, RaftStorageCompleter completer, EntryJournalV1 journal, int queueCapacity)
-
-
Method Details
-
journal
-
appendEntry
Append a log entry to the journal.- Parameters:
entry- the entry to appendcallback- the callback to invoke- Throws:
InterruptedException- if interrupted while waiting
-
discardHead
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
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
- Throws:
InterruptedException
-
cancelAndTerminate
public void cancelAndTerminate() -
processAndTerminate
-
run
public void run()
-