public class MemoryRaftLog 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 |
|---|
MemoryRaftLog(RaftGroupMemberId memberId,
long commitIndex,
RaftProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
protected CompletableFuture<Long> |
appendEntryImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto entry) |
List<CompletableFuture<Long>> |
appendImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto... logEntryProtos) |
org.apache.ratis.proto.RaftProtos.LogEntryProto |
get(long index)
Get the log entry of the given index.
|
TermIndex[] |
getEntries(long startIndex,
long endIndex) |
String |
getEntryString() |
RaftLog.EntryWithData |
getEntryWithData(long index)
Get the log entry of the given index along with the state machine data.
|
long |
getFlushIndex() |
TermIndex |
getLastEntryTermIndex() |
long |
getStartIndex() |
TermIndex |
getTermIndex(long index)
Get the TermIndex information of the given index.
|
boolean |
isConfigEntry(TermIndex ti) |
RaftLog.Metadata |
loadMetadata() |
protected CompletableFuture<Long> |
purgeImpl(long index) |
void |
syncWithSnapshot(long lastSnapshotIndex) |
protected CompletableFuture<Long> |
truncateImpl(long index) |
void |
writeMetadata(long term,
RaftPeerId votedFor)
Write and flush the metadata (votedFor and term) into the meta file.
|
append, append, append, appendEntry, appendMetadata, checkLogState, close, contains, getLastCommittedIndex, getName, getNextIndex, getRaftLogMetrics, getSnapshotIndex, hasReadLock, hasWriteLock, isOpened, open, openImpl, purge, readLock, toLogEntryString, toString, truncate, updateLastCommitted, updateSnapshotIndex, validateLogEntry, writeLockpublic MemoryRaftLog(RaftGroupMemberId memberId, long commitIndex, RaftProperties properties)
public org.apache.ratis.proto.RaftProtos.LogEntryProto get(long index)
RaftLogpublic RaftLog.EntryWithData getEntryWithData(long index)
RaftLoggetEntryWithData in class RaftLogindex - The given index.public 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)protected CompletableFuture<Long> truncateImpl(long index)
truncateImpl in class RaftLogprotected CompletableFuture<Long> purgeImpl(long index)
public TermIndex getLastEntryTermIndex()
getLastEntryTermIndex in class RaftLogprotected CompletableFuture<Long> appendEntryImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto entry)
appendEntryImpl in class RaftLogpublic long getStartIndex()
getStartIndex in class RaftLogpublic List<CompletableFuture<Long>> appendImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto... logEntryProtos)
appendImpl in class RaftLogpublic String getEntryString()
public long getFlushIndex()
getFlushIndex in class RaftLogpublic void writeMetadata(long term,
RaftPeerId votedFor)
RaftLogwriteMetadata in class RaftLogpublic RaftLog.Metadata loadMetadata()
loadMetadata in class RaftLogpublic void syncWithSnapshot(long lastSnapshotIndex)
syncWithSnapshot in class RaftLogpublic boolean isConfigEntry(TermIndex ti)
isConfigEntry in class RaftLogCopyright © 2017–2020 The Apache Software Foundation. All rights reserved.