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 2021/11/05 15:05:17 UTC

[GitHub] [pinot] walterddr commented on a change in pull request #7705: follow up with picocli migration

walterddr commented on a change in pull request #7705:
URL: https://github.com/apache/pinot/pull/7705#discussion_r743741066



##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/perf/PerfBenchmarkRunner.java
##########
@@ -191,8 +191,8 @@ public static void loadTable(PerfBenchmarkDriver driver, String dataDir, String
   public static void main(String[] args)
       throws Exception {
     PerfBenchmarkRunner perfBenchmarkRunner = new PerfBenchmarkRunner();
-    CmdLineParser parser = new CmdLineParser(perfBenchmarkRunner);
-    parser.parseArgument(args);
+    CommandLine commandLine = new CommandLine(perfBenchmarkRunner);
+    CommandLine.ParseResult parseResult = commandLine.parseArgs(args);

Review comment:
       ```suggestion
       commandLine.parseArgs(args);
   ```

##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/SegmentDumpTool.java
##########
@@ -35,29 +35,25 @@
 import org.apache.pinot.spi.data.Schema;
 import org.apache.pinot.spi.data.readers.GenericRow;
 import org.apache.pinot.spi.utils.ReadMode;
-import org.kohsuke.args4j.Argument;
-import org.kohsuke.args4j.CmdLineParser;
-import org.kohsuke.args4j.Option;
-import org.kohsuke.args4j.spi.StringArrayOptionHandler;
+import picocli.CommandLine;
 
 
+@CommandLine.Command
 public class SegmentDumpTool extends AbstractBaseCommand implements Command {
-  @Argument
-  @Option(name = "-path", required = true, metaVar = "<string>",
-      usage = "Path of the folder containing the segment" + " file")
+  @CommandLine.Option(names = {"-path"}, required = true,
+      description = "Path of the folder containing the segment" + " file")
   private String _segmentDir = null;
 
-  @Argument(index = 1, multiValued = true)
-  @Option(name = "-columns", handler = StringArrayOptionHandler.class, usage = "Columns to dump")
+  @CommandLine.Option(names = {"-columns"}, arity = "1..*", description = "Columns to dump")
   private List<String> _columnNames;
 
-  @Option(name = "-dumpStarTree")
+  @CommandLine.Option(names = {"-dumpStarTree"})
   private boolean _dumpStarTree = false;
 
   public void doMain(String[] args)
       throws Exception {
-    CmdLineParser parser = new CmdLineParser(this);
-    parser.parseArgument(args);
+    CommandLine commandLine = new CommandLine(this);
+    CommandLine.ParseResult parseResult = commandLine.parseArgs(args);

Review comment:
       ```suggestion
       commandLine.parseArgs(args);
   ```

##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/segment/converter/DictionaryToRawIndexConverter.java
##########
@@ -394,8 +408,8 @@ private int getLengthOfLongestEntry(Dictionary dictionary) {
   public static void main(String[] args)
       throws Exception {
     DictionaryToRawIndexConverter converter = new DictionaryToRawIndexConverter();
-    CmdLineParser parser = new CmdLineParser(converter);
-    parser.parseArgument(args);
+    CommandLine commandLine = new CommandLine(converter);
+    CommandLine.ParseResult parseResult = commandLine.parseArgs(args);

Review comment:
       ```suggestion
       commandLine.parseArgs(args);
   ```

##########
File path: pinot-tools/src/main/java/org/apache/pinot/tools/perf/QueryRunner.java
##########
@@ -911,9 +913,8 @@ public String toString() {
   public static void main(String[] args)
       throws Exception {
     QueryRunner queryRunner = new QueryRunner();
-    CmdLineParser parser = new CmdLineParser(queryRunner);
-    parser.parseArgument(args);
-
+    CommandLine commandLine = new CommandLine(queryRunner);
+    CommandLine.ParseResult parseResult = commandLine.parseArgs(args);

Review comment:
       ```suggestion
       commandLine.parseArgs(args);
   ```




-- 
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