| 程序包 | 说明 |
|---|---|
| org.apache.ratis.statemachine |
| 限定符和类型 | 方法和说明 |
|---|---|
TransactionContext |
StateMachine.applyTransactionSerial(TransactionContext trx)
Called for transactions that have been committed to the RAFT log.
|
TransactionContext |
TransactionContext.Builder.build() |
TransactionContext |
TransactionContext.cancelTransaction()
Called to notify the state machine that the Transaction passed cannot be appended (or synced).
|
TransactionContext |
StateMachine.cancelTransaction(TransactionContext trx)
Called to notify the state machine that the Transaction passed cannot be appended (or synced).
|
TransactionContext |
TransactionContext.preAppendTransaction()
This is called before the transaction passed from the StateMachine is appended to the raft log.
|
TransactionContext |
StateMachine.preAppendTransaction(TransactionContext trx)
This is called before the transaction passed from the StateMachine is appended to the raft log.
|
TransactionContext |
TransactionContext.setException(Exception exception)
Set exception in case of failure.
|
TransactionContext |
TransactionContext.setShouldCommit(boolean shouldCommit)
Sets whether to commit the transaction to the RAFT log or not
|
TransactionContext |
TransactionContext.setStateMachineContext(Object stateMachineContext)
Sets the
StateMachine the TransactionContext is specific to, the method would
not create a new transaction context, it updates the StateMachine it associates with |
TransactionContext |
StateMachine.startTransaction(RaftClientRequest request)
Start a transaction for the given request.
|
default TransactionContext |
StateMachine.startTransaction(org.apache.ratis.proto.RaftProtos.LogEntryProto entry,
org.apache.ratis.proto.RaftProtos.RaftPeerRole role)
Start a transaction for the given log entry for non-leaders.
|
| 限定符和类型 | 方法和说明 |
|---|---|
CompletableFuture<Message> |
StateMachine.applyTransaction(TransactionContext trx)
Apply a committed log entry to the state machine.
|
TransactionContext |
StateMachine.applyTransactionSerial(TransactionContext trx)
Called for transactions that have been committed to the RAFT log.
|
TransactionContext |
StateMachine.cancelTransaction(TransactionContext trx)
Called to notify the state machine that the Transaction passed cannot be appended (or synced).
|
TransactionContext |
StateMachine.preAppendTransaction(TransactionContext trx)
This is called before the transaction passed from the StateMachine is appended to the raft log.
|
default CompletableFuture<org.apache.ratis.thirdparty.com.google.protobuf.ByteString> |
StateMachine.DataApi.read(org.apache.ratis.proto.RaftProtos.LogEntryProto entry,
TransactionContext context)
Read asynchronously the state machine data from this state machine.
|
default CompletableFuture<?> |
StateMachine.DataApi.write(org.apache.ratis.proto.RaftProtos.LogEntryProto entry,
TransactionContext context)
Write asynchronously the state machine data in the given log entry to this state machine.
|
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
StateMachine.LeaderEventApi.notifyNotLeader(Collection<TransactionContext> pendingEntries)
Notify
StateMachine that this server is no longer the leader. |
Copyright © 2017–2025 The Apache Software Foundation. All rights reserved.