Use the natively supported version and usage by picocli#10672
Use the natively supported version and usage by picocli#10672jonas-grgt wants to merge 3 commits intoapache:masterfrom jonas-grgt:use-native-picocli-for-version-and-help
Conversation
walterddr
left a comment
There was a problem hiding this comment.
thank you for the PR, can you clean up the linter issue and submit again.
I ran checkstyle and fixed all open issues. |
There seems to be more then checkstyle in place. I suppose I need to get the built green. I'll look into it. |
Codecov Report
@@ Coverage Diff @@
## master #10672 +/- ##
============================================
+ Coverage 64.38% 64.43% +0.05%
- Complexity 6441 6462 +21
============================================
Files 2068 2106 +38
Lines 111794 113512 +1718
Branches 16956 17262 +306
============================================
+ Hits 71974 73137 +1163
- Misses 34646 35122 +476
- Partials 5174 5253 +79
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 219 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
pinot-tools/src/main/java/org/apache/pinot/tools/admin/PinotAdministrator.java
Outdated
Show resolved
Hide resolved
|
@walterddr Saw an attempt was made to built the project but, failed due to incompatibility with java 8. Think I forgot to actually push my changes 🙈 In any case it should now pass, can you try again ? Also what is the reason for supporting JDK-8 as a minimum version ? |
I think it was because some users were still on JDK8. we are in the process of removing it (for a while unfortunately) |
| */ | ||
| package org.apache.pinot.tools.admin; | ||
|
|
||
| import java.io.StringWriter; |
There was a problem hiding this comment.
| import java.io.StringWriter; | |
| import com.google.common.collect.ImmutableMap; | |
| import java.io.StringWriter; |
| static class VersionsStub extends Versions { | ||
| @Override | ||
| public Map<String, String> getComponentVersions() { | ||
| return new TreeMap<>(Map.of("AddSchema", "1.2.3", "AddTable", "1.2.4")); |
There was a problem hiding this comment.
| return new TreeMap<>(Map.of("AddSchema", "1.2.3", "AddTable", "1.2.4")); | |
| return new TreeMap<>(ImmutableMap.of("AddSchema", "1.2.3", "AddTable", "1.2.4")); |
| pinotAdministrator.execute(new String[]{"AddSchema", "--help"}); | ||
|
|
||
| // then | ||
| assertEquals(out.toString(), "Usage: <main class> AddSchema [-hV] [-exec] [-authToken=<_authToken>]\n" |
There was a problem hiding this comment.
this assertEquals is going to be hard to maintain if we add additional commands. was wondering how other project use picocli handles unit-test? do we have a util to generate these expected results?
| + " QueryRunner -mode singleThread -queryFile <queryFile> -numTimesToRunQueries 0 " | ||
| + "-numIntervalsToReportAndClearStatistics 5\n" | ||
| + " QueryRunner -mode multiThreads -queryFile <queryFile> -numThreads 10 -reportIntervalMs 1000\n" | ||
| + " QueryRunner -mode targetQPS -queryFile <queryFile> -startQPS 50\n" | ||
| + " QueryRunner -mode increasingQPS -queryFile <queryFile> -startQPS 50 -deltaQPS 10 " | ||
| + "-numIntervalsToIncreaseQPS 20\n"; |
There was a problem hiding this comment.
did we missed these examples in the new format?
| // @Override | ||
| // public void getDescription() { | ||
| // System.out.println("mv [-o] <source-uri> <destination-uri>"); | ||
| // } |
There was a problem hiding this comment.
remove these comments if no longer needed
| } | ||
|
|
||
| @Override | ||
| public void printExamples() { |
There was a problem hiding this comment.
is this description refactored anywhere in the new code? can't find it
Instructions:
featurebugfix(*) Other labels to consider:
testingrefactorcleanupThe general idea was to make use of the natively supported
mixinStandardHelpOptionsof picocli.I took the liberty to add some tests for the
PinotAdministrator.Amy feedback more then welcome I'm happy to adjust the code in order to get it merged in and improve pinot!