public abstract class RaftLogBase extends Object implements RaftLog
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RaftLogSequentialOps.Runner |
RaftLog.EntryWithData| 限定符和类型 | 字段和说明 |
|---|---|
static long |
INVALID_LOG_INDEX |
static long |
LEAST_VALID_LOG_INDEX
The least valid log index, i.e. the index used when writing to an empty log.
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
RaftLogBase(RaftGroupMemberId memberId,
LongSupplier getSnapshotIndexFromStateMachine,
RaftProperties properties) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, get, getEntries, getEntryWithData, getFlushIndex, getLastEntryTermIndex, getNextIndex, getRaftLogMetrics, getStartIndex, getTermIndex, loadMetadata, onSnapshotInstalled, persistMetadatapublic static final long LEAST_VALID_LOG_INDEX
public static final long INVALID_LOG_INDEX
protected RaftLogBase(RaftGroupMemberId memberId, LongSupplier getSnapshotIndexFromStateMachine, RaftProperties properties)
public long getLastCommittedIndex()
getLastCommittedIndex 在接口中 RaftLogpublic long getSnapshotIndex()
getSnapshotIndex 在接口中 RaftLogpublic void checkLogState()
public boolean isOpened()
public boolean updateCommitIndex(long majorityIndex,
long currentTerm,
boolean isLeader)
updateCommitIndex 在接口中 RaftLogprotected void updateSnapshotIndexFromStateMachine()
public void updateSnapshotIndex(long newSnapshotIndex)
updateSnapshotIndex 在接口中 RaftLogpublic final long append(long term,
TransactionContext transaction)
throws StateMachineException
public final long appendMetadata(long term,
long newCommitIndex)
public final long append(long term,
RaftConfiguration configuration)
public final void open(long lastIndexInSnapshot,
Consumer<org.apache.ratis.proto.RaftProtos.LogEntryProto> consumer)
throws IOException
open 在接口中 RaftLogIOExceptionprotected void openImpl(long lastIndexInSnapshot,
Consumer<org.apache.ratis.proto.RaftProtos.LogEntryProto> consumer)
throws IOException
IOExceptionprotected void validateLogEntry(org.apache.ratis.proto.RaftProtos.LogEntryProto entry)
public final CompletableFuture<Long> truncate(long index)
protected abstract CompletableFuture<Long> truncateImpl(long index)
public final CompletableFuture<Long> purge(long suggestedIndex)
protected abstract CompletableFuture<Long> purgeImpl(long index)
public final CompletableFuture<Long> appendEntry(org.apache.ratis.proto.RaftProtos.LogEntryProto entry)
protected abstract CompletableFuture<Long> appendEntryImpl(org.apache.ratis.proto.RaftProtos.LogEntryProto entry)
public final List<CompletableFuture<Long>> append(List<org.apache.ratis.proto.RaftProtos.LogEntryProto> entries)
protected abstract List<CompletableFuture<Long>> appendImpl(List<org.apache.ratis.proto.RaftProtos.LogEntryProto> entries)
public AutoCloseableLock readLock()
public AutoCloseableLock writeLock()
public boolean hasWriteLock()
public boolean hasReadLock()
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic String getName()
protected RaftLog.EntryWithData newEntryWithData(org.apache.ratis.proto.RaftProtos.LogEntryProto logEntry, CompletableFuture<org.apache.ratis.thirdparty.com.google.protobuf.ByteString> future)
public String toLogEntryString(org.apache.ratis.proto.RaftProtos.LogEntryProto logEntry)
@Deprecated public List<CompletableFuture<Long>> append(org.apache.ratis.proto.RaftProtos.LogEntryProto... arg0)
Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.