-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[improve][txn] Add getState in transaction for client API #17423
[improve][txn] Add getState in transaction for client API #17423
Conversation
pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
I hope it can be cherry-picked to release branches from |
@Anonymitaet Please help review the Java Doc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to correct me if my understanding is inaccurate, thanks!
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java
Outdated
Show resolved
Hide resolved
…ransaction/Transaction.java Co-authored-by: Anonymitaet <[email protected]>
…state_interface' into congbobo184_txn_add_transaction_state_interface
@Anonymitaet @codelipenghui I have fixed the comments, please review again. Thanks! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Approved from a technical writing perspective. 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@congbobo184 would you mind to explain a case where the user needs to know the state of the transaction object? could you explain what are the actions they can take based on the state?
I'm ok with the pull itself but since we're adding it to the public API (and maintain it forever even if the internal transaction mechanism changes) we need a strong reason
@nicoloboschi I see a transaction production user. They are using |
…_transaction_state_interface
### Motivation now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state. user can get the transaction state to do user's own op. ### Modifications 1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction` `getState` 2. TransactionImpl implement the interface ``` * Get transaction state. * * @return {@link State} the state of the transaction. */ State getState(); ``` ### Verifying this change add the test (cherry picked from commit a9531db)
### Motivation now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state. user can get the transaction state to do user's own op. ### Modifications 1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction` `getState` 2. TransactionImpl implement the interface ``` * Get transaction state. * * @return {@link State} the state of the transaction. */ State getState(); ``` ### Verifying this change add the test (cherry picked from commit a9531db)
### Motivation now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state. user can get the transaction state to do user's own op. ### Modifications 1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction` `getState` 2. TransactionImpl implement the interface ``` * Get transaction state. * * @return {@link State} the state of the transaction. */ State getState(); ``` ### Verifying this change add the test (cherry picked from commit a9531db)
### Motivation now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state. user can get the transaction state to do user's own op. ### Modifications 1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction` `getState` 2. TransactionImpl implement the interface ``` * Get transaction state. * * @return {@link State} the state of the transaction. */ State getState(); ``` ### Verifying this change add the test (cherry picked from commit a9531db) (cherry picked from commit db4fbfb)
now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state. user can get the transaction state to do user's own op. 1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction` `getState` 2. TransactionImpl implement the interface ``` * Get transaction state. * * @return {@link State} the state of the transaction. */ State getState(); ``` add the test (cherry picked from commit a9531db)
Cherry-picked by #19834 |
#17423) (#19834) Co-authored-by: congbo <[email protected]>
Motivation
now
org.apache.pulsar.client.api.transaction.Transaction
dont have a interface for user to get the transaction state.user can get the transaction state to do user's own op.
Modifications
org.apache.pulsar.client.api.transaction.Transaction
getState
Verifying this change
add the test
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Does this pull request introduce a new feature? (yes)
If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
If a feature is not applicable for documentation, explain why?
If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
doc-not-needed