枚举 Transaction.State
- java.lang.Object
-
- java.lang.Enum<Transaction.State>
-
- org.apache.pulsar.client.api.transaction.Transaction.State
-
- 所有已实现的接口:
java.io.Serializable,java.lang.Comparable<Transaction.State>
- 封闭接口:
- Transaction
public static enum Transaction.State extends java.lang.Enum<Transaction.State>
-
-
枚举常量概要
枚举常量 枚举常量 说明 ABORTEDWhen a client receives a response to an abort, the transaction state is changed from `ABORTING` to `ABORTED`.ABORTINGWhen a client invokes an abort, the transaction state is changed from `OPEN` to `ABORTING`.COMMITTEDWhen a client receives a response to a commit, the transaction state is changed from `COMMITTING` to `COMMITTED`.COMMITTINGWhen a client invokes a commit, the transaction state is changed from `OPEN` to `COMMITTING`.ERRORWhen a client invokes a commit or an abort, but a transaction does not exist in a coordinator, then the state is changed to `ERROR`.OPENWhen a transaction is in the `OPEN` state, messages can be produced and acked with this transaction.TIME_OUTWhen a transaction is timed out and the transaction state is `OPEN`, then the transaction state is changed from `OPEN` to `TIME_OUT`.
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static Transaction.StatevalueOf(java.lang.String name)返回带有指定名称的该类型的枚举常量。static Transaction.State[]values()按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。
-
-
-
枚举常量详细资料
-
OPEN
public static final Transaction.State OPEN
When a transaction is in the `OPEN` state, messages can be produced and acked with this transaction. When a transaction is in the `OPEN` state, it can commit or abort.
-
COMMITTING
public static final Transaction.State COMMITTING
When a client invokes a commit, the transaction state is changed from `OPEN` to `COMMITTING`.
-
ABORTING
public static final Transaction.State ABORTING
When a client invokes an abort, the transaction state is changed from `OPEN` to `ABORTING`.
-
COMMITTED
public static final Transaction.State COMMITTED
When a client receives a response to a commit, the transaction state is changed from `COMMITTING` to `COMMITTED`.
-
ABORTED
public static final Transaction.State ABORTED
When a client receives a response to an abort, the transaction state is changed from `ABORTING` to `ABORTED`.
-
ERROR
public static final Transaction.State ERROR
When a client invokes a commit or an abort, but a transaction does not exist in a coordinator, then the state is changed to `ERROR`. When a client invokes a commit, but the transaction state in a coordinator is `ABORTED` or `ABORTING`, then the state is changed to `ERROR`. When a client invokes an abort, but the transaction state in a coordinator is `COMMITTED` or `COMMITTING`, then the state is changed to `ERROR`.
-
TIME_OUT
public static final Transaction.State TIME_OUT
When a transaction is timed out and the transaction state is `OPEN`, then the transaction state is changed from `OPEN` to `TIME_OUT`.
-
-
方法详细资料
-
values
public static Transaction.State[] values()
按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:for (Transaction.State c : Transaction.State.values()) System.out.println(c);
- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
public static Transaction.State valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
java.lang.IllegalArgumentException- 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException- 如果参数为空值
-
-