public class BaseStateMachine extends Object implements StateMachine, StateMachine.DataApi, StateMachine.EventApi, StateMachine.LeaderEventApi, StateMachine.FollowerEventApi
| 限定符和类型 | 类和说明 |
|---|---|
protected static interface |
BaseStateMachine.Task |
StateMachine.DataApi, StateMachine.DataChannel, StateMachine.DataStream, StateMachine.EventApi, StateMachine.FollowerEventApi, StateMachine.LeaderEventApi, StateMachine.RegistryLOGDEFAULTDEFAULTDEFAULTDEFAULT| 构造器和说明 |
|---|
BaseStateMachine() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdata, event, followerEvent, leaderEvent, toStateMachineLogEntryStringflush, link, read, stream, truncate, writenotifyConfigurationChanged, notifyGroupRemove, notifyLeaderChanged, notifyLogFailed, notifyServerShutdown, notifySnapshotInstallednotifyFollowerSlowness, notifyFollowerSlowness, notifyNotLeadernotifyExtendedNoLeader, notifyInstallSnapshotFromLeaderpublic RaftPeerId getId()
public LifeCycle getLifeCycle()
public CompletableFuture<RaftServer> getServer()
public RaftGroupId getGroupId()
public LifeCycle.State getLifeCycleState()
getLifeCycleState 在接口中 StateMachinepublic void initialize(RaftServer raftServer, RaftGroupId raftGroupId, RaftStorage storage) throws IOException
initialize 在接口中 StateMachineIOExceptionpublic SnapshotInfo getLatestSnapshot()
getLatestSnapshot 在接口中 StateMachinepublic void pause()
pause 在接口中 StateMachinepublic void reinitialize()
throws IOException
reinitialize 在接口中 StateMachineIOExceptionpublic TransactionContext applyTransactionSerial(TransactionContext trx) throws org.apache.ratis.thirdparty.com.google.protobuf.InvalidProtocolBufferException
public CompletableFuture<Message> applyTransaction(TransactionContext trx)
applyTransaction 在接口中 StateMachinepublic TermIndex getLastAppliedTermIndex()
getLastAppliedTermIndex 在接口中 StateMachineprotected void setLastAppliedTermIndex(TermIndex newTI)
public void notifyTermIndexUpdated(long term,
long index)
notifyTermIndexUpdated 在接口中 StateMachine.EventApiprotected boolean updateLastAppliedTermIndex(long term,
long index)
protected boolean updateLastAppliedTermIndex(TermIndex newTI)
public long takeSnapshot()
throws IOException
takeSnapshot 在接口中 StateMachineIOExceptionpublic StateMachineStorage getStateMachineStorage()
getStateMachineStorage 在接口中 StateMachinepublic CompletableFuture<Message> queryStale(Message request, long minIndex)
queryStale 在接口中 StateMachinepublic CompletableFuture<Message> query(Message request)
query 在接口中 StateMachinepublic TransactionContext startTransaction(RaftClientRequest request) throws IOException
startTransaction 在接口中 StateMachineIOExceptionpublic TransactionContext cancelTransaction(TransactionContext trx) throws IOException
cancelTransaction 在接口中 StateMachineIOExceptionpublic TransactionContext preAppendTransaction(TransactionContext trx) throws IOException
preAppendTransaction 在接口中 StateMachineIOExceptionpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionprotected CompletableFuture<Message> recordTime(com.codahale.metrics.Timer timer, BaseStateMachine.Task task)
Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.