You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/10/17 08:06:43 UTC

[GitHub] [pinot] navina opened a new pull request, #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

navina opened a new pull request, #9608:
URL: https://github.com/apache/pinot/pull/9608

   Some of the commands don't print help properly due to the use of a deprecated `help` annotation. This PT attempts to clean-up some of the commands launched by `PinotToolLauncher`. 
   
   Labels: `cleanup` 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] navina commented on a diff in pull request #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

Posted by GitBox <gi...@apache.org>.
navina commented on code in PR #9608:
URL: https://github.com/apache/pinot/pull/9608#discussion_r1001001394


##########
pinot-tools/src/main/java/org/apache/pinot/tools/AutoAddInvertedIndexTool.java:
##########
@@ -66,23 +66,18 @@ public class AutoAddInvertedIndexTool extends AbstractBaseCommand implements Com
           + AutoAddInvertedIndex.DEFAULT_MAX_NUM_INVERTED_INDEX_ADDED)
   private int _maxNumInvertedIndex = AutoAddInvertedIndex.DEFAULT_MAX_NUM_INVERTED_INDEX_ADDED;
 
-  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = false, help = true,
+  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = false, usageHelp = true,
       description = "Print this message.")
   private boolean _help = false;
 
   @Override
-  public boolean getHelp() {
-    return _help;
-  }
-
-  @Override
-  public String getName() {

Review Comment:
   likely



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on code in PR #9608:
URL: https://github.com/apache/pinot/pull/9608#discussion_r1004871882


##########
pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkRunner.java:
##########
@@ -194,11 +194,6 @@ public static void main(String[] args)
     PerfBenchmarkRunner perfBenchmarkRunner = new PerfBenchmarkRunner();
     CommandLine commandLine = new CommandLine(perfBenchmarkRunner);
     commandLine.parseArgs(args);
-
-    if (perfBenchmarkRunner._help) {
-      perfBenchmarkRunner.printUsage();
-    } else {
-      perfBenchmarkRunner.execute();
-    }
+    commandLine.execute();

Review Comment:
   Should not ignore the help



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang merged pull request #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang merged PR #9608:
URL: https://github.com/apache/pinot/pull/9608


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on code in PR #9608:
URL: https://github.com/apache/pinot/pull/9608#discussion_r999911006


##########
pinot-tools/src/main/java/org/apache/pinot/tools/AutoAddInvertedIndexTool.java:
##########
@@ -66,23 +66,18 @@ public class AutoAddInvertedIndexTool extends AbstractBaseCommand implements Com
           + AutoAddInvertedIndex.DEFAULT_MAX_NUM_INVERTED_INDEX_ADDED)
   private int _maxNumInvertedIndex = AutoAddInvertedIndex.DEFAULT_MAX_NUM_INVERTED_INDEX_ADDED;
 
-  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = false, help = true,
+  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = false, usageHelp = true,
       description = "Print this message.")
   private boolean _help = false;
 
   @Override
-  public boolean getHelp() {
-    return _help;
-  }
-
-  @Override
-  public String getName() {

Review Comment:
   Is this removed accidentally?



##########
pinot-perf/src/main/java/org/apache/pinot/perf/RawIndexBenchmark.java:
##########
@@ -303,6 +303,10 @@ public static void main(String[] args)
     RawIndexBenchmark benchmark = new RawIndexBenchmark();
     CommandLine commandLine = new CommandLine(benchmark);
     commandLine.parseArgs(args);
+    if (commandLine.isUsageHelpRequested() || commandLine.parseArgs(args).matchedArgs().size() == 0) {

Review Comment:
   Avoid parsing args twice



##########
pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkRunner.java:
##########
@@ -194,11 +194,6 @@ public static void main(String[] args)
     PerfBenchmarkRunner perfBenchmarkRunner = new PerfBenchmarkRunner();
     CommandLine commandLine = new CommandLine(perfBenchmarkRunner);
     commandLine.parseArgs(args);
-
-    if (perfBenchmarkRunner._help) {
-      perfBenchmarkRunner.printUsage();
-    } else {
-      perfBenchmarkRunner.execute();
-    }
+    commandLine.execute();

Review Comment:
   Follow the same convention



##########
pinot-tools/src/main/java/org/apache/pinot/tools/SegmentDumpTool.java:
##########
@@ -149,7 +146,14 @@ private void dumpStarTree()
 
   public static void main(String[] args)
       throws Exception {
-    new SegmentDumpTool().doMain(args);
+    SegmentDumpTool tool = new SegmentDumpTool();
+    CommandLine commandLine = new CommandLine(tool);
+    commandLine.parseArgs(args);

Review Comment:
   (minor) Move this into `else`, or try to match arguments similar to `RawIndexBenchmark`



##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/RealtimeProvisioningHelperCommand.java:
##########
@@ -345,4 +345,17 @@ private <T> T deserialize(File file, Class<T> clazz) {
           String.format("Cannot read schema file '%s' to '%s' object.", file, clazz.getSimpleName()), e);
     }
   }
+
+  public static void main(String[] args)
+      throws IOException {
+    RealtimeProvisioningHelperCommand rtProvisioningHelper = new RealtimeProvisioningHelperCommand();
+    CommandLine cmdLine = new CommandLine(rtProvisioningHelper);
+    cmdLine.parseArgs(args);
+    if (rtProvisioningHelper.getHelp()) {

Review Comment:
   Same here. Try to follow the same convention for all of them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [pinot] codecov-commenter commented on pull request #9608: Using `usageHelp` instead of deprecated `help` in picocli commands

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #9608:
URL: https://github.com/apache/pinot/pull/9608#issuecomment-1286837949

   # [Codecov](https://codecov.io/gh/apache/pinot/pull/9608?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#9608](https://codecov.io/gh/apache/pinot/pull/9608?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8646c95) into [master](https://codecov.io/gh/apache/pinot/commit/fafb518f757cdfeb198c3b4accd0c72b97e9d72c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fafb518) will **increase** coverage by `34.74%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             master    #9608       +/-   ##
   =============================================
   + Coverage     28.06%   62.81%   +34.74%     
   - Complexity       53     4707     +4654     
   =============================================
     Files          1935     1935               
     Lines        103815   103815               
     Branches      15757    15757               
   =============================================
   + Hits          29134    65207    +36073     
   + Misses        71808    33729    -38079     
   - Partials       2873     4879     +2006     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration1 | `25.86% <ø> (-0.04%)` | :arrow_down: |
   | integration2 | `24.54% <ø> (-0.02%)` | :arrow_down: |
   | unittests1 | `67.34% <ø> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pinot/pull/9608?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ntroller/helix/core/minion/TaskMetricsEmitter.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL21pbmlvbi9UYXNrTWV0cmljc0VtaXR0ZXIuamF2YQ==) | `34.88% <0.00%> (-51.17%)` | :arrow_down: |
   | [...r/validation/RealtimeSegmentValidationManager.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci92YWxpZGF0aW9uL1JlYWx0aW1lU2VnbWVudFZhbGlkYXRpb25NYW5hZ2VyLmphdmE=) | `55.40% <0.00%> (-18.92%)` | :arrow_down: |
   | [.../controller/helix/core/SegmentDeletionManager.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL1NlZ21lbnREZWxldGlvbk1hbmFnZXIuamF2YQ==) | `52.50% <0.00%> (-9.38%)` | :arrow_down: |
   | [...roller/helix/core/relocation/SegmentRelocator.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlbG9jYXRpb24vU2VnbWVudFJlbG9jYXRvci5qYXZh) | `72.97% <0.00%> (-5.41%)` | :arrow_down: |
   | [...e/pinot/controller/helix/SegmentStatusChecker.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9TZWdtZW50U3RhdHVzQ2hlY2tlci5qYXZh) | `72.15% <0.00%> (-4.55%)` | :arrow_down: |
   | [...lix/core/minion/PinotHelixTaskResourceManager.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL21pbmlvbi9QaW5vdEhlbGl4VGFza1Jlc291cmNlTWFuYWdlci5qYXZh) | `29.64% <0.00%> (-2.27%)` | :arrow_down: |
   | [...r/helix/SegmentOnlineOfflineStateModelFactory.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zZXJ2ZXIvc3RhcnRlci9oZWxpeC9TZWdtZW50T25saW5lT2ZmbGluZVN0YXRlTW9kZWxGYWN0b3J5LmphdmE=) | `56.43% <0.00%> (-1.99%)` | :arrow_down: |
   | [.../apache/pinot/controller/util/TableSizeReader.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci91dGlsL1RhYmxlU2l6ZVJlYWRlci5qYXZh) | `76.22% <0.00%> (-1.64%)` | :arrow_down: |
   | [...lix/core/realtime/PinotRealtimeSegmentManager.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlYWx0aW1lL1Bpbm90UmVhbHRpbWVTZWdtZW50TWFuYWdlci5qYXZh) | `71.20% <0.00%> (-1.05%)` | :arrow_down: |
   | [.../core/realtime/PinotLLCRealtimeSegmentManager.java](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29udHJvbGxlci9oZWxpeC9jb3JlL3JlYWx0aW1lL1Bpbm90TExDUmVhbHRpbWVTZWdtZW50TWFuYWdlci5qYXZh) | `57.20% <0.00%> (-0.76%)` | :arrow_down: |
   | ... and [1084 more](https://codecov.io/gh/apache/pinot/pull/9608/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org