public class SegmentedRaftLog extends RaftLog
| Modifier and Type | Class and Description |
|---|---|
static class |
RaftLogSequentialOps.Runner |
RaftLog.EntryWithData, RaftLog.MetadataINVALID_LOG_INDEX, LEAST_VALID_LOG_INDEX, LOG, LOG_SYNC| Constructor and Description |
|---|
SegmentedRaftLog(RaftGroupMemberId memberId,
RaftServerImpl server,
RaftStorage storage,
long lastIndexInSnapshot,
RaftProperties properties) |
append, append, append, appendEntry, appendMetadata, checkLogState, contains, getLastCommittedIndex, getName, getNextIndex, getRaftLogMetrics, getSnapshotIndex, hasReadLock, hasWriteLock, isOpened, open, purge, readLock, truncate, updateLastCommitted, updateSnapshotIndex, validateLogEntry, writeLockpublic SegmentedRaftLog(RaftGroupMemberId memberId, RaftServerImpl server, RaftStorage storage, long lastIndexInSnapshot, RaftProperties properties)
protected void openImpl(long lastIndexInSnapshot,
Consumer<org.apache.ratis.proto.RaftProtos.LogEntryProto> consumer)
throws IOException
openImpl in class RaftLogIOExceptionpublic long getStartIndex()
getStartIndex in class RaftLogpublic org.apache.ratis.proto.RaftProtos.LogEntryProto get(long index) throws RaftLogIOException
RaftLogget in class RaftLogindex - The given index.RaftLogIOExceptionpublic RaftLog.EntryWithData getEntryWithData(long index) throws RaftLogIOException
RaftLoggetEntryWithData in class RaftLogindex - The given index.RaftLogIOExceptionpublic TermIndex getTermIndex(long index)
RaftLoggetTermIndex in class RaftLogindex - The given index.public TermIndex[] getEntries(long startIndex, long endIndex)
getEntries in class RaftLogstartIndex - the starting log index (inclusive)endIndex - the ending log index (exclusive)public TermIndex getLastEntryTermIndex()
getLastEntryTermIndex in class RaftLogprotected CompletableFuture<Long> truncateImpl(long index)
truncateImpl in class RaftLogprotected CompletableFuture<Long> purgeImpl(long index)
protected CompletableFuture<Long> appendEntryImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto entry)
appendEntryImpl in class RaftLogpublic List<CompletableFuture<Long>> appendImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto... entries)
appendImpl in class RaftLogpublic long getFlushIndex()
getFlushIndex in class RaftLogpublic void writeMetadata(long term,
RaftPeerId votedFor)
throws IOException
RaftLogwriteMetadata in class RaftLogIOExceptionpublic RaftLog.Metadata loadMetadata() throws IOException
loadMetadata in class RaftLogIOExceptionpublic void syncWithSnapshot(long lastSnapshotIndex)
syncWithSnapshot in class RaftLogpublic boolean isConfigEntry(TermIndex ti)
isConfigEntry in class RaftLogpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class RaftLogIOExceptionpublic String toLogEntryString(org.apache.ratis.proto.RaftProtos.LogEntryProto logEntry)
toLogEntryString in class RaftLogCopyright © 2017–2020 The Apache Software Foundation. All rights reserved.