Package io.atomix.storage.journal
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSegmented byte journal builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidclose()voidcompact(long index) longlonggetCompactableIndex(long index) Returns the index of the last segment in the log.booleanisCompactable(long index) Returns a boolean indicating whether a segment can be removed from the journal prior to the given index.longorg.opendaylight.controller.raft.journal.EntryReaderopenCommitsReader(long index) org.opendaylight.controller.raft.journal.EntryReaderopenReader(long index) longsize()Returns the total size of the journal.org.opendaylight.controller.raft.journal.EntryWriterwriter()
-
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:
firstIndexin interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
lastIndex
public long lastIndex()- Specified by:
lastIndexin interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
writer
public org.opendaylight.controller.raft.journal.EntryWriter writer()- Specified by:
writerin interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
openReader
public org.opendaylight.controller.raft.journal.EntryReader openReader(long index) - Specified by:
openReaderin interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
openCommitsReader
public org.opendaylight.controller.raft.journal.EntryReader openCommitsReader(long index) - Specified by:
openCommitsReaderin interfaceorg.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:
compactin interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceorg.opendaylight.controller.raft.journal.RaftJournal
-
builder
-