-
Notifications
You must be signed in to change notification settings - Fork 40
Replace ScalarDbMode with core TransactionMode for clarity #3181
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
Summary of ChangesHello @ypeckstadt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the data loader architecture by decoupling its core logic from CLI-specific transaction mode definitions. It introduces a new, more descriptive Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request is a significant refactoring that improves the clarity and architecture of the data loader. By replacing the CLI-specific ScalarDbMode with a more descriptive core TransactionMode enum, you've successfully decoupled the core module and made the transaction behavior more explicit. The simplification of using DistributedTransactionManager for all database interactions, including single CRUD operations, is a great improvement that streamlines the data access layer. The changes are consistent across the codebase, including updates to tests and deprecation of old options. I have a few suggestions to further enhance the clarity of the new terminology in Javadocs and class names.
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 refactors the data loader architecture by replacing the ScalarDbMode enum with a new TransactionMode enum in the core module, providing more descriptive terminology that accurately reflects the underlying transaction behavior. The CLI module maintains the deprecated ScalarDbMode for backward compatibility with existing users.
- Introduced
TransactionModeenum withSINGLE_CRUDandCONSENSUS_COMMITvalues - Updated all core classes and tests to use the new
TransactionMode - Moved and deprecated
ScalarDbModeto the CLI package - Renamed methods for consistency (e.g.,
processStorageRecord→processSingleCrudRecord)
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| data-loader/core/src/main/java/com/scalar/db/dataloader/core/TransactionMode.java | New enum defining transaction modes with clear documentation for SINGLE_CRUD and CONSENSUS_COMMIT |
| data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataimport/processor/ImportProcessorParams.java | Updated to use TransactionMode instead of ScalarDbMode with improved field documentation |
| data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataimport/processor/ImportProcessor.java | Method names updated for clarity and documentation revised to use new terminology |
| data-loader/core/src/main/java/com/scalar/db/dataloader/core/dataimport/ImportManager.java | Updated field and parameter to use TransactionMode |
| data-loader/core/src/test/java/com/scalar/db/dataloader/core/dataimport/processor/JsonLinesImportProcessorTest.java | Test methods renamed and updated to use TransactionMode |
| data-loader/core/src/test/java/com/scalar/db/dataloader/core/dataimport/processor/JsonImportProcessorTest.java | Test methods renamed and updated to use TransactionMode |
| data-loader/core/src/test/java/com/scalar/db/dataloader/core/dataimport/processor/ImportProcessorTest.java | Test methods renamed and updated to use TransactionMode with improved naming conventions |
| data-loader/core/src/test/java/com/scalar/db/dataloader/core/dataimport/processor/CsvImportProcessorTest.java | Test methods renamed and updated to use TransactionMode |
| data-loader/core/src/test/java/com/scalar/db/dataloader/core/dataimport/ImportManagerTest.java | Test updated to use TransactionMode |
| data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/ScalarDbMode.java | Moved from core to cli package and marked as deprecated with proper annotations |
| data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/command/dataimport/ImportCommand.java | Added conversion method from ScalarDbMode to TransactionMode for backward compatibility |
| data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/command/dataimport/ImportCommandOptions.java | Updated import path to reference cli package ScalarDbMode |
Comments suppressed due to low confidence (1)
data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/ScalarDbMode.java:27
- Missing period after "3.17.0" in the deprecation notice. Should be "As of release 3.17.0." to be consistent with line 18 and line 7.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
data-loader/cli/src/main/java/com/scalar/db/dataloader/cli/ScalarDbMode.java
Show resolved
Hide resolved
brfrn169
left a comment
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!
3f005c0 to
1e2b5b2
Compare
feeblefakie
left a comment
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!
1e2b5b2 to
79edfbe
Compare
thongdk8
left a comment
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!
79edfbe to
cad5823
Compare
Torch3333
left a comment
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!
|
@komamitsu Can you take a quick look? |
komamitsu
left a comment
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! 👍
Description
This PR refactors the data loader architecture to decouple the usage of
modein the core module from the CLI-specificmodethat is still being used but does not really match what is happening in the core code.The core module now uses a new TransactionMode enum with more descriptive terminology that accurately reflects the underlying transaction behavior (SINGLE_CRUD and CONSENSUS_COMMIT), while the CLI maintains backward compatibility with the existing ScalarDbMode enum, for now. This enum will be completely removed once the ScalarDB Cluster config is exposed to the client as well.
This PR is not high priority and is ok if cant be included with 3.17 release.Related issues and/or PRs
NA
Changes made
Core Module (data-loader/core)
CLI Module (data-loader/cli)
Checklist
Additional notes (optional)
NA
Release notes
Replaced ScalarDbMode with core TransactionMode for clarity