-
Notifications
You must be signed in to change notification settings - Fork 40
Reverse thread argument deprecation for Data Loader CLI #3118
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 clarifies thread-related command-line interface arguments for the Data Loader CLI by reversing the deprecation status of 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 effectively reverses the deprecation status for the thread-related CLI arguments, making --threads the primary option and deprecating --max-threads. The associated refactoring to rename the internal variable to threadCount is applied consistently across all relevant files, including command-line options, core logic, and tests. The addition of new tests to verify the behavior of the deprecated and new options is a good improvement. I've identified one issue where a validation check in the export command would prevent the use of the default thread count, which I've detailed in a specific comment.
...-loader/cli/src/main/java/com/scalar/db/dataloader/cli/command/dataexport/ExportCommand.java
Show resolved
Hide resolved
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 threading option naming from --max-threads to --threads throughout the data loader codebase, making --max-threads the deprecated option while --threads becomes the new primary option. This reverses the previous relationship where --threads was deprecated in favor of --max-threads.
Key changes:
- Renamed the
maxThreadsfield tothreadCountin all affected classes - Swapped the roles:
--threadsis now the primary option,--max-threadsis deprecated - Updated error messages, validation logic, and test cases accordingly
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ImportOptions.java | Renamed field from maxThreads to threadCount |
| ImportProcessor.java | Updated method calls to use getThreadCount() instead of getMaxThreads() |
| DataLoaderError.java | Renamed error constant from INVALID_MAX_THREADS to INVALID_THREAD_COUNT |
| ImportCommandOptions.java | Swapped primary option to --threads and deprecated option to --max-threads |
| ImportCommand.java | Updated validation and option building to use threadCount |
| ExportCommandOptions.java | Added deprecated --max-threads option with migration logic |
| ExportCommand.java | Updated validation and option building to use threadCount |
| Various test files | Updated tests to use new naming and added test coverage for deprecated option handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Will be done via other PR as some other changes need to be handled first. |
Description
This PR reverses the deprecation status of thread-related CLI arguments and renames the internal Java variable for better clarity. The
--threadsargument is now the primary option, while--max-threadsbecomes deprecated. This change is based on feedback that describes the originalthreadsargument is clearer.Related issues and/or PRs
NA
Changes made
--threadsfrom deprecated to primary CLI argument--max-threadsfrom primary to deprecated CLI argumentVariable Renaming
maxThreadstothreadCountacross:ExportCommandOptions.javaandImportCommandOptions.javaExportCommand.javaandImportCommand.javaImportOptions.java(core module)ImportProcessor.java(core module)Validation Updates
INVALID_MAX_THREADStoINVALID_THREAD_COUNTapplyDeprecatedOptions()properly handles the reversed deprecationChecklist
Additional notes (optional)
NA
Release notes
Reversed thread argument deprecation for Data Loader CLI