Anonymitaet commented on code in PR #17423:
URL: https://github.com/apache/pulsar/pull/17423#discussion_r962583382


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.

Review Comment:
   ```suggestion
            * When a transaction is in the `OPEN` state, it can commit or abort.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.

Review Comment:
   ```suggestion
            * When a client invokes a commit, the transaction state is changed 
from `OPEN` to `COMMITTING`.
   ```
   Do you mean this?



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.

Review Comment:
   ```suggestion
            * When a transaction is in the `OPEN` state, messages can be 
produced and acked with transactions.
   ```
   Do you mean this?



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.

Review Comment:
   ```suggestion
            * When a client invokes an abort, the transaction state is changed 
from `OPEN` to `ABORTING`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,

Review Comment:
   ```suggestion
            * When a client invokes a commit or an abort, but a transaction 
does not exist in a coordinator,
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.

Review Comment:
   ```suggestion
            * When a client receives a response to an abort, the transaction 
state is changed from `ABORTING` to `ABORTED`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.

Review Comment:
   ```suggestion
            * When a client receives a response to a commit, the transaction 
state is changed from `COMMITTING` to `COMMITTED`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the transaction state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in 
coordinator is committed or committing,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the transaction state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in 
coordinator is committed or committing,

Review Comment:
   ```suggestion
            * When a client invokes a commit, but the transaction state in a 
coordinator is `COMMITTED` or `COMMITTING`,
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in 
coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in 
coordinator is aborted or aborting,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in 
coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in 
coordinator is aborted or aborting,
+         * the state will change to `ERROR`.
+         */
+        ERROR,
+
+        /**
+         * When the transaction timeout and the state is in `OPEN`, the state 
will change to `TIME_OUT` from `OPEN`.

Review Comment:
   ```suggestion
            * When a transaction is timed out and the transaction state is 
`OPEN`, then the transaction state is changed from `OPEN` to `TIME_OUT`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.

Review Comment:
   Write in the simple present tense as much as possible if you are covering 
facts that were, are, and forever shall be true. 
https://docs.google.com/document/d/1lc5j4RtuLIzlEYCBo97AC8-U_3Erzs_lxpkDuseU0n4/edit#bookmark=id.e8uqh1awkcnp



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with 
transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to 
`COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` 
from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will 
change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will 
change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist 
in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in 
coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in 
coordinator is aborted or aborting,

Review Comment:
   ```suggestion
            * When a client invokes an abort, but the transaction state in a 
coordinator is `ABORTED` or `ABORTING`,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to