-
Notifications
You must be signed in to change notification settings - Fork 39
Add scanner API to transaction abstraction #2729
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
Conversation
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.
Pull Request Overview
This PR integrates a new scanner API into the transaction abstraction layer by adding the getScanner method to various transaction and transaction manager implementations. Key changes include:
- Adding a getScanner(Scan) method override in DecoratedTwoPhaseCommitTransactionManager, DecoratedTwoPhaseCommitTransaction, DecoratedDistributedTransactionManager, DecoratedDistributedTransaction, and active transaction managed classes.
- Introducing new scanner interfaces and implementations in CrudOperable and its related abstractions.
- Minor updates to documentation and integration tests to support the scanner API.
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
core/src/main/java/com/scalar/db/common/DecoratedTwoPhaseCommitTransactionManager.java | Added delegation for getScanner to the underlying transaction manager |
core/src/main/java/com/scalar/db/common/DecoratedTwoPhaseCommitTransaction.java | Added getScanner override delegating to the underlying transaction |
core/src/main/java/com/scalar/db/common/DecoratedDistributedTransactionManager.java | Added getScanner override for distributed transactions |
core/src/main/java/com/scalar/db/common/DecoratedDistributedTransaction.java | Added getScanner override delegating to the underlying distributed transaction |
core/src/main/java/com/scalar/db/common/ActiveTransactionManagedTwoPhaseCommitTransactionManager.java | Added synchronized getScanner override |
core/src/main/java/com/scalar/db/common/ActiveTransactionManagedDistributedTransactionManager.java | Added synchronized getScanner override |
core/src/main/java/com/scalar/db/common/AbstractTransactionManagerCrudOperableScanner.java | Introduced new abstract scanner class for TransactionManagerCrudOperable |
core/src/main/java/com/scalar/db/common/AbstractTransactionCrudOperableScanner.java | Introduced new abstract scanner class for TransactionCrudOperable |
core/src/main/java/com/scalar/db/common/AbstractCrudOperableScanner.java | Added implementation for iterator semantics over scanner results |
core/src/java/api classes | Updated scanner interfaces in TransactionManagerCrudOperable, TransactionCrudOperable, Scanner, and CrudOperable with comprehensive Javadoc comments to describe scanner behavior |
Integration tests | Added @test annotations to previously disabled test methods to ensure proper scanner-related behavior validation |
* (e.g., a conflict error). You can retry the transaction from the beginning | ||
* @throws CrudException if the transaction CRUD operation fails due to transient or nontransient | ||
* faults. You can try retrying the transaction from the beginning, but the transaction may | ||
* still fail if the cause is nontranient |
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.
Consider correcting the spelling of 'nontranient' to 'nontransient' in the documentation to improve clarity.
* still fail if the cause is nontranient | |
* still fail if the cause is nontransient |
Copilot uses AI. Check for mistakes.
* (e.g., a conflict error). You can retry the transaction from the beginning | ||
* @throws CrudException if the transaction CRUD operation fails due to transient or nontransient | ||
* faults. You can try retrying the transaction from the beginning, but the transaction may | ||
* still fail if the cause is nontranient |
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.
Consider correcting the spelling of 'nontranient' to 'nontransient' in the documentation to improve clarity.
* still fail if the cause is nontranient | |
* still fail if the cause is nontransient |
Copilot uses AI. Check for mistakes.
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.
Besides the two typos picked up by Copilot above.
LGTM, thank you.
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.
LGTM, thank you!
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.
LGTM! Thank you!
Fixing the typos?
@feeblefakie @Torch3333 I’ll fix the typo in a separate PR, since the same typo also exists in the existing code. Thanks! |
Description
This PR adds a scanner API to the transaction abstraction for iteratively retrieving results. It simply merges the
add-scanner-api-to-transaction-abstraction
feature branch into themaster
branch, and the code has already been reviewed.Related issues and/or PRs
Changes made
add-scanner-api-to-transaction-abstraction
feature branch to themaster
branchChecklist
Additional notes (optional)
N/A
Release notes
Added a scanner API to the transaction abstraction for iteratively retrieving results.