-
Notifications
You must be signed in to change notification settings - Fork 148
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
[#770] feat(cli): Introduce apache.commons.cli basic framework #833
Conversation
@smallzhongfeng @jerqi Can you help to review this pr? Thank you very much! |
Codecov Report
@@ Coverage Diff @@
## master #833 +/- ##
============================================
+ Coverage 57.09% 59.32% +2.22%
- Complexity 2148 2165 +17
============================================
Files 321 305 -16
Lines 15655 13388 -2267
Branches 1243 1249 +6
============================================
- Hits 8939 7943 -996
+ Misses 6212 5009 -1203
+ Partials 504 436 -68
... and 25 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
bin/stop-coordinator.sh
Outdated
@@ -21,6 +21,7 @@ set -o pipefail | |||
set -o nounset # exit the script if you try to use an uninitialised variable | |||
set -o errexit # exit the script if any statement returns a non-true return value | |||
|
|||
UNIFFLE_SHELL_SCRIPT_DEBUG=true |
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.
Could we put UNIFFLE_SHELL_SCRIPT_DEBUG=true
into utils.sh
and load_rss_env
?
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.
I will modify the code.
bin/uniffle-function.sh
Outdated
function uniffle_generic_java_subcmd_handler | ||
{ | ||
uniffle_java_exec "${UNIFFLE_SUBCMD}" "${UNIFFLE_CLASSNAME}" "${UNIFFLE_SUBCMD_ARGS[@]}" | ||
} |
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.
Add a new line. There is a warning.
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 helping to review the code, I will fix it.
cc @Kwafoor |
fc3176c
to
9aaf2c2
Compare
import org.apache.uniffle.UniffleCliArgsException; | ||
|
||
|
||
public class ExampleCLI extends AbstractCustomCommandLine { |
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.
Could we have a better name?
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.
What about UniffleTestCLI
?
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.
Why do we need an ExampleCli? Coulw we have a UniffleCli directly?
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.
Why do we need an ExampleCli? Coulw we have a UniffleCli directly?
Thank you for your suggestion! I will modify the class name, and I will continue to complete subTask in this class, #837, #846.
My idea is to provide a sample class for testing, so it is called exampleCLI
, but it is called uniffleCLI
, which is a better choice.
bin/uniffle
Outdated
set +u | ||
uniffle_cmd_case "${UNIFFLE_SUBCMD}" "${UNIFFLE_SUBCMD_ARGS[@]}" | ||
uniffle_generic_java_subcmd_handler | ||
set -u |
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.
There should be a new line.
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.
I will fix it.
cli/pom.xml
Outdated
<artifactId>commons-cli</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
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.
There should be a new line.
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.
I will fix it.
Thank you for your question! In the case of In general, I believe that At present, there are only a few known commands for Do you think this approach would be feasible? |
I'm ok. |
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. also cc @jerqi After merging this PR, we can start developing some other commands.
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
Do we need modify the description? Is there some update? |
@kaijchen Do you have another suggestion? You have more experience about Ratis and Ozone client. If you have another suggestion, you can raise some follow-up prs. |
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.
Merged. Thanks all
@jerqi @smallzhongfeng Thank you very much for reviewing the code and providing suggestions for modification! |
What changes were proposed in this pull request?
We use
apache.commons.cli
to add commands toUniffle
. I created a command calleduniffle
, the following is the case of using the command.Why are the changes needed?
We use apache.commons.cli to add commands to Uniffle.
Does this PR introduce any user-facing change?
No.
How was this patch tested?