Enum Class TxState
- All Implemented Interfaces:
Serializable
,Comparable<TxState>
,Constable
RaftKVTransaction
states.
Transactions always progress through these states in the forward direction (i.e., in their natural order).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe transaction is closed.The transaction is ready for commit.The transaction is waiting for the corresponding Raft log entry to be committed.The transaction has committed successfully or failed, and is waiting to be cleaned up.The transaction is open, executing locally, and neitherRaftKVTransaction.commit()
norRaftKVTransaction.rollback()
has been invoked yet. -
Method Summary
-
Enum Constant Details
-
EXECUTING
The transaction is open, executing locally, and neitherRaftKVTransaction.commit()
norRaftKVTransaction.rollback()
has been invoked yet.No network communication with any other node has occurred yet on behalf of the transaction.
-
COMMIT_READY
The transaction is ready for commit.RaftKVTransaction.commit()
has been invoked, but the transaction has not otherwise been dealt with yet. If we are a follower, it will be transmitted to the leader once the leader is known and his output queue becomes empty; while we are waiting for the response from the leader, the transaction remains in this state. If we are the leader, it will be dealt with locally as soon as we can get to it. -
COMMIT_WAITING
The transaction is waiting for the corresponding Raft log entry to be committed.The transaction has been assigned a commit term and index by the leader. We are waiting for the corresponding Raft log entry to be committed to the Raft log.
-
COMPLETED
The transaction has committed successfully or failed, and is waiting to be cleaned up.The thread that invoked
RaftKVTransaction.commit()
orRaftKVTransaction.rollback()
has not yet woken up and returned from the invocation. The transaction'scommitFuture
has been completed one way or another. -
CLOSED
The transaction is closed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-