Skip to content

Conversation

@clarax
Copy link
Contributor

@clarax clarax commented Jun 18, 2020

…a list of region names/table names/namespaces

Copy link
Contributor

@wchevreuil wchevreuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liked the idea of making all commands that accept list of regions to consistently also accept list of files containing the regions. Just small nit remarks to update the description to all commands that got modified here, together with the related UT testing this additional feature.

of what a userspace encoded region name looks like. For example:
$ HBCK2 unassign 1588230740 de00010733901a05f5a2a3a382e27dd4
Returns the pid(s) of the created UnassignProcedure(s) or -1 if none.
If -i or --inputFiles is specified, pass one or more input file names.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should modify the command params description on line #274 to:

unassigns <ENCODED_REGIONNAME|-i INPUT_FILES>

Copy link
Contributor Author

@clarax clarax Jun 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added -i as a utility option for all commands that take a list of argument. So the syntax is
hbck -i command inputfiles

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need still to update README for each of the modified commands. For example, assigns descriptions reads:
assigns [OPTIONS] <ENCODED_REGIONNAME/INPUTFILES_FOR_REGIONNAMES>...

But extraRegionsInMeta still reads:
extraRegionsInMeta <NAMESPACE|NAMESPACE:TABLENAME>...

However, command usage for modified commands do mention the correct parameters, so we should make README consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new behavior is surprising to me. It's surprising because the -i is accepted as a global flag but it's arguments come after the subcommand. That's not a common feature in command line utilities that I'm familiar with. I'm not convinced this is a good behavior.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed , I think we need to define "-i " option well (and remove --inputFiles to avoid confusion), that it just alter the way the args are expected by the command, if "-i" is used and a file is not passed, a user should see an error

OR

your earlier suggestion make it local to every command so that it can be defined as "extraRegionsInMeta -i " instead of global "-i extraRegionsInMeta " .

I think if it is well defined both options are good but we can choose one and proceed, I'm more inclining also towards "local" option as we anyways have to describe them for each command. let me know your thoughts so that we can close on this.

new FsRegionsMetaRecoverer(this.conf)) {
report = fsRegionsMetaRecoverer.reportTablesMissingRegions(
formatNameSpaceTableParam(nameSpaceOrTable));
report = fsRegionsMetaRecoverer.reportTablesMissingRegions(getFromArgsOrFiles(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing UT and updates to reportMissingRegionsInMeta command description (as it now accepts list of files)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for reportMissingRegionsInMeta. See TestHBCK2.testReportMissingRegionsInMeta.

try (final FsRegionsMetaRecoverer fsRegionsMetaRecoverer =
new FsRegionsMetaRecoverer(this.conf)) {
List<String> namespacesTables = formatNameSpaceTableParam(commandLine.getArgs());
List<String> namespacesTables = getFromArgsOrFiles(formatNameSpaceTableParam(commandLine.getArgs()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing UT and updates to extraRegionsInMeta command description (as it now accepts list of files)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for when files are passed as parameter. See TestHBCK2.testFormatFixExtraInMetaOneExtraSpecificTable.

new FsRegionsMetaRecoverer(this.conf)) {
return fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(
formatNameSpaceTableParam(nameSpaceOrTable));
return fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(getFromArgsOrFiles(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing UT and updates to addFsRegionsMissingInMeta command description (as it now accepts list of files)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for the condition where files are passed as input. See TestHBCK2.testAddMissingRegionsInMetaForTables

Copy link
Contributor

@wchevreuil wchevreuil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are still not testing the extra methods changed to receive a list of files as parameters. We should add this condition on UTs for _ reportTablesWithMissingRegionsInMeta_, extraRegionsInMeta, _addMissingRegionsInMetaForTables, bypass, scheduleRecoveries.

of what a userspace encoded region name looks like. For example:
$ HBCK2 unassign 1588230740 de00010733901a05f5a2a3a382e27dd4
Returns the pid(s) of the created UnassignProcedure(s) or -1 if none.
If -i or --inputFiles is specified, pass one or more input file names.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need still to update README for each of the modified commands. For example, assigns descriptions reads:
assigns [OPTIONS] <ENCODED_REGIONNAME/INPUTFILES_FOR_REGIONNAMES>...

But extraRegionsInMeta still reads:
extraRegionsInMeta <NAMESPACE|NAMESPACE:TABLENAME>...

However, command usage for modified commands do mention the correct parameters, so we should make README consistent.

new FsRegionsMetaRecoverer(this.conf)) {
return fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(
formatNameSpaceTableParam(nameSpaceOrTable));
return fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(getFromArgsOrFiles(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for the condition where files are passed as input. See TestHBCK2.testAddMissingRegionsInMetaForTables

try (final FsRegionsMetaRecoverer fsRegionsMetaRecoverer =
new FsRegionsMetaRecoverer(this.conf)) {
List<String> namespacesTables = formatNameSpaceTableParam(commandLine.getArgs());
List<String> namespacesTables = getFromArgsOrFiles(formatNameSpaceTableParam(commandLine.getArgs()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for when files are passed as parameter. See TestHBCK2.testFormatFixExtraInMetaOneExtraSpecificTable.

}
String[] pidStrs = commandLine.getArgs();
if (pidStrs == null || pidStrs.length <= 0) {
List<String> pidStrs = getFromArgsOrFiles(commandLine.getArgList());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires UT for the new parameter option.

}

List<Long> scheduleRecoveries(Hbck hbck, String[] args) throws IOException {
List<String> arglist = getFromArgsOrFiles(Arrays.asList(args));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requires UT for the new parameter option.

new FsRegionsMetaRecoverer(this.conf)) {
report = fsRegionsMetaRecoverer.reportTablesMissingRegions(
formatNameSpaceTableParam(nameSpaceOrTable));
report = fsRegionsMetaRecoverer.reportTablesMissingRegions(getFromArgsOrFiles(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing UT for reportMissingRegionsInMeta. See TestHBCK2.testReportMissingRegionsInMeta.

If -i or --inputFiles is specified, pass one or more input file names.
Each file contains encoded region names, one per line. For example:
$ HBCK2 assigns -i fileName1 fileName2
$ HBCK2 -i assigns fileName1 fileName2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command comes after the -i? I think this was correct before the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to a utility wide option like --skip

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should this docstring be HBCK2 -i fileName1 fileName2 assigns ... ? Or maybe don't document -i here in the assigns subcommand because it's a "global" feature.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea here is that "-i" changes how the args are expected by the command so instead of they being listed as on console, the command will accept the file instead but values/format would be different for different commands.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 16s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 1s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
-1 ❌ mvninstall 0m 17s root in master failed.
-1 ❌ compile 0m 18s hbase-hbck2 in master failed.
-1 ❌ checkstyle 0m 26s The patch fails to run checkstyle in hbase-hbck2
-1 ❌ javadoc 0m 18s hbase-hbck2 in master failed.
_ Patch Compile Tests _
-1 ❌ mvninstall 0m 18s hbase-hbck2 in the patch failed.
+1 💚 compile 0m 40s the patch passed
+1 💚 javac 0m 40s the patch passed
-1 ❌ checkstyle 0m 1s The patch fails to run checkstyle in hbase-hbck2
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
-1 ❌ javadoc 0m 3s hbase-hbck2 in the patch failed.
_ Other Tests _
-1 ❌ unit 0m 3s hbase-hbck2 in the patch failed.
+0 🆗 asflicense 0m 2s ASF License check generated no output?
4m 4s
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 61aad65f9996 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / 87878aa
Default Java Oracle Corporation-1.8.0_265-b01
mvninstall https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-mvninstall-root.txt
compile https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-compile-hbase-hbck2.txt
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/buildtool-branch-checkstyle-hbase-hbck2.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-javadoc-hbase-hbck2.txt
mvninstall https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-mvninstall-hbase-hbck2.txt
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/buildtool-patch-checkstyle-hbase-hbck2.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-javadoc-hbase-hbck2.txt
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/testReport/
Max. process+thread count 52 (vs. ulimit of 1000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/1/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 0m 58s master passed
+1 💚 compile 0m 16s master passed
+1 💚 checkstyle 0m 11s master passed
+1 💚 javadoc 0m 11s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 18s the patch passed
+1 💚 compile 0m 16s the patch passed
+1 💚 javac 0m 16s the patch passed
-1 ❌ checkstyle 0m 9s hbase-hbck2: The patch generated 9 new + 3 unchanged - 2 fixed = 12 total (was 5)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 8s the patch passed
_ Other Tests _
-1 ❌ unit 18m 35s hbase-hbck2 in the patch failed.
+1 💚 asflicense 0m 8s The patch does not generate ASF License warnings.
21m 58s
Reason Tests
Failed junit tests hbase.TestHBCK2
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux ee302be4afae 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / 87878aa
Default Java Oracle Corporation-1.8.0_265-b01
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/diff-checkstyle-hbase-hbck2.txt
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/testReport/
Max. process+thread count 910 (vs. ulimit of 1000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 37s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
-1 ❌ mvninstall 0m 18s root in master failed.
-1 ❌ compile 0m 17s hbase-hbck2 in master failed.
-1 ❌ checkstyle 0m 16s The patch fails to run checkstyle in hbase-hbck2
-1 ❌ javadoc 0m 18s hbase-hbck2 in master failed.
_ Patch Compile Tests _
-1 ❌ mvninstall 0m 18s hbase-hbck2 in the patch failed.
-1 ❌ compile 0m 17s hbase-hbck2 in the patch failed.
-1 ❌ javac 0m 17s hbase-hbck2 in the patch failed.
-1 ❌ checkstyle 0m 15s The patch fails to run checkstyle in hbase-hbck2
+1 💚 whitespace 0m 1s The patch has no whitespace issues.
-1 ❌ javadoc 0m 17s hbase-hbck2 in the patch failed.
_ Other Tests _
-1 ❌ unit 0m 18s hbase-hbck2 in the patch failed.
+0 🆗 asflicense 0m 17s ASF License check generated no output?
3m 52s
Subsystem Report/Notes
Docker ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 932ec5fe3be5 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / 87878aa
Default Java Oracle Corporation-1.8.0_265-b01
mvninstall https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-mvninstall-root.txt
compile https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-compile-hbase-hbck2.txt
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/buildtool-branch-checkstyle-hbase-hbck2.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/branch-javadoc-hbase-hbck2.txt
mvninstall https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-mvninstall-hbase-hbck2.txt
compile https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-compile-hbase-hbck2.txt
javac https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-compile-hbase-hbck2.txt
checkstyle https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/buildtool-patch-checkstyle-hbase-hbck2.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-javadoc-hbase-hbck2.txt
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/testReport/
Max. process+thread count 29 (vs. ulimit of 1000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-Connectors-PreCommit/job/PR-69/1/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@busbey
Copy link
Contributor

busbey commented Jan 15, 2021

@clarax still working on this?

@clarax clarax force-pushed the HBASE-24587-fix branch from 2134e8a to d74cc53 Compare March 1, 2022 01:07
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 37s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 0m 48s master passed
+1 💚 compile 0m 11s master passed
+1 💚 checkstyle 0m 7s master passed
+1 💚 javadoc 0m 7s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 12s the patch passed
+1 💚 compile 0m 10s the patch passed
+1 💚 javac 0m 10s the patch passed
-1 ❌ checkstyle 0m 5s hbase-hbck2: The patch generated 9 new + 0 unchanged - 0 fixed = 9 total (was 0)
-1 ❌ whitespace 0m 0s The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply
+1 💚 javadoc 0m 6s the patch passed
_ Other Tests _
+1 💚 unit 3m 39s hbase-hbck2 in the patch passed.
+1 💚 asflicense 0m 6s The patch does not generate ASF License warnings.
7m 19s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 885f8905d9c9 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
checkstyle https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/diff-checkstyle-hbase-hbck2.txt
whitespace https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/artifact/yetus-precommit-check/output/whitespace-eol.txt
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/testReport/
Max. process+thread count 1215 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/2/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 41s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 0m 46s master passed
+1 💚 compile 0m 10s master passed
+1 💚 checkstyle 0m 8s master passed
+1 💚 javadoc 0m 7s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 11s the patch passed
+1 💚 compile 0m 10s the patch passed
+1 💚 javac 0m 10s the patch passed
-1 ❌ checkstyle 0m 5s hbase-hbck2: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 6s the patch passed
_ Other Tests _
-1 ❌ unit 3m 41s hbase-hbck2 in the patch failed.
+1 💚 asflicense 0m 6s The patch does not generate ASF License warnings.
7m 23s
Reason Tests
Failed junit tests hbase.TestHBCKCommandLineParsing
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/3/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 5c28f1fd1c68 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
checkstyle https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/3/artifact/yetus-precommit-check/output/diff-checkstyle-hbase-hbck2.txt
unit https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/3/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/3/testReport/
Max. process+thread count 1222 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/3/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@clarax
Copy link
Contributor Author

clarax commented Mar 1, 2022

@wchevreuil @ndimiduk Thank you for the feedback. Sorry I shelved this for other priorities. I am back to finish this. The changes are:

  1. added a common -i option so any command that takes a list of argument can take a list of input files.
  2. updated the -h message and README.
  3. added a unit test for the generic option and test this option for assigns and unassigns. For other commands, since they all share the same code path, I don't see a need to add more ut. The existing ut for other command don't touch generic options either.
  4. for commands that take two arguments(table|resgion state), I opened a separate jira and pr for taking the pairs in a list of files. https://issues.apache.org/jira/browse/HBASE-26785 but later decided to include here.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 4s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 1m 58s master passed
+1 💚 compile 0m 10s master passed
+1 💚 checkstyle 0m 7s master passed
+1 💚 javadoc 0m 7s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 11s the patch passed
+1 💚 compile 0m 10s the patch passed
+1 💚 javac 0m 10s the patch passed
-1 ❌ checkstyle 0m 5s hbase-hbck2: The patch generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 6s the patch passed
_ Other Tests _
+1 💚 unit 3m 34s hbase-hbck2 in the patch passed.
+1 💚 asflicense 0m 5s The patch does not generate ASF License warnings.
7m 47s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/4/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 9a9541eb8003 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
checkstyle https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/4/artifact/yetus-precommit-check/output/diff-checkstyle-hbase-hbck2.txt
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/4/testReport/
Max. process+thread count 1210 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/4/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

add unit test for the new -i option

update README
@clarax clarax force-pushed the HBASE-24587-fix branch from de17813 to 4735bf7 Compare March 1, 2022 23:03
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 2m 28s master passed
+1 💚 compile 0m 10s master passed
+1 💚 checkstyle 0m 7s master passed
+1 💚 javadoc 0m 8s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 11s the patch passed
+1 💚 compile 0m 9s the patch passed
+1 💚 javac 0m 9s the patch passed
+1 💚 checkstyle 0m 4s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 5s the patch passed
_ Other Tests _
+1 💚 unit 3m 28s hbase-hbck2 in the patch passed.
+1 💚 asflicense 0m 6s The patch does not generate ASF License warnings.
7m 42s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/5/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 3ab23ae7519a 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/5/testReport/
Max. process+thread count 1211 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/5/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 37s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
-1 ❌ mvninstall 2m 56s root in master failed.
+1 💚 compile 0m 34s master passed
+1 💚 checkstyle 0m 7s master passed
+1 💚 javadoc 0m 8s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 12s the patch passed
+1 💚 compile 0m 9s the patch passed
+1 💚 javac 0m 9s the patch passed
+1 💚 checkstyle 0m 4s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 5s the patch passed
_ Other Tests _
-1 ❌ unit 16m 18s hbase-hbck2 in the patch failed.
+1 💚 asflicense 0m 6s The patch does not generate ASF License warnings.
21m 25s
Reason Tests
Failed junit tests hbase.TestHBCK2
hbase.TestHBCKCommandLineParsing
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/6/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux a7d4702ae314 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
mvninstall https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/6/artifact/yetus-precommit-check/output/branch-mvninstall-root.txt
unit https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/6/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/6/testReport/
Max. process+thread count 1201 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/6/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 5s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 0m 46s master passed
+1 💚 compile 0m 11s master passed
+1 💚 checkstyle 0m 6s master passed
+1 💚 javadoc 0m 7s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 11s the patch passed
+1 💚 compile 0m 10s the patch passed
+1 💚 javac 0m 10s the patch passed
+1 💚 checkstyle 0m 5s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 5s the patch passed
_ Other Tests _
-1 ❌ unit 15m 22s hbase-hbck2 in the patch failed.
+1 💚 asflicense 0m 5s The patch does not generate ASF License warnings.
18m 26s
Reason Tests
Failed junit tests hbase.TestHBCKCommandLineParsing
hbase.TestHBCK2
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/7/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux d975cbd2e4f5 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
unit https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/7/artifact/yetus-precommit-check/output/patch-unit-hbase-hbck2.txt
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/7/testReport/
Max. process+thread count 1220 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/7/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@clarax clarax force-pushed the HBASE-24587-fix branch from 2861dfb to 2090da0 Compare March 2, 2022 23:23
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 8s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 0m 54s master passed
+1 💚 compile 0m 10s master passed
+1 💚 checkstyle 0m 7s master passed
+1 💚 javadoc 0m 7s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 12s the patch passed
+1 💚 compile 0m 10s the patch passed
+1 💚 javac 0m 10s the patch passed
+1 💚 checkstyle 0m 4s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 6s the patch passed
_ Other Tests _
+1 💚 unit 3m 35s hbase-hbck2 in the patch passed.
+1 💚 asflicense 0m 6s The patch does not generate ASF License warnings.
6m 47s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/8/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 67c579d8c97d 5.4.0-1047-aws #49~18.04.1-Ubuntu SMP Wed Apr 28 23:08:58 UTC 2021 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/8/testReport/
Max. process+thread count 1259 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/8/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@clarax
Copy link
Contributor Author

clarax commented Mar 3, 2022

@wchevreuil @ndimiduk all ready. Please review.

Copy link
Member

@ndimiduk ndimiduk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this command line argument construction feels awkward to me. Did you consider a more "unix-like" approach of reading input arguments from stdin? You can detect the absence of arguments as a trigger to read from stdin, or explicitly look for the argument -. So instead of

$ hbck2 -i <subcommand> file

It might work like,

$ echo file | hbck2 <subcommand>

usage: HBCK2 [OPTIONS] COMMAND <ARGS>
Options:
-d,--debug run with debug output
-i, --inputfiles take one or more files to read the args from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need document the new argument only once. It looks like the camel-case version, inputFiles is what your parser change accepts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was per @wchevreuil 's feedback.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nick is suggesting this @clarax

Suggested change
-i, --inputfiles take one or more files to read the args from
-i, --inputFiles take one or more files to read the args from

If -i or --inputFiles is specified, pass one or more input file names.
Each file contains encoded region names, one per line. For example:
$ HBCK2 assigns -i fileName1 fileName2
$ HBCK2 -i assigns fileName1 fileName2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should this docstring be HBCK2 -i fileName1 fileName2 assigns ... ? Or maybe don't document -i here in the assigns subcommand because it's a "global" feature.

-r,--recursive bypass parent and its children. SLOW! EXPENSIVE!
-w,--lockWait milliseconds to wait before giving up; default=1
Pass one (or more) procedure 'pid's to skip to procedure finish. Parent
Pass one (or more) procedure 'pid's to skip to procedure finish. Parent
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintentional whitespace change?

reportMissingRegionsInMeta <NAMESPACE|NAMESPACE:TABLENAME>...
To be used when regions missing from hbase:meta but directories
To be used when regions missing from hbase:meta but directories
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another unintentional whitespace change?

of what a userspace encoded region name looks like. For example:
$ HBCK2 unassign 1588230740 de00010733901a05f5a2a3a382e27dd4
Returns the pid(s) of the created UnassignProcedure(s) or -1 if none.
If -i or --inputFiles is specified, pass one or more input file names.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new behavior is surprising to me. It's surprising because the -i is accepted as a global flag but it's arguments come after the subcommand. That's not a common feature in command line utilities that I'm familiar with. I'm not convinced this is a good behavior.

@clarax
Copy link
Contributor Author

clarax commented Mar 3, 2022

When I implemented for assigns and unassigns, I used -i after command. But once I tried to implement for all commands, I realized it could be a global flag. Making it a flag for individual command would have to deal with different parsing and validation for every single command which requires significant refactoring, code duplication and much more unit tests.

But if we foresee adding more options to individual commands down the road, it is worth to standardize various command parsing/validation logic.

@ankitsinghal ankitsinghal requested a review from wchevreuil March 17, 2022 17:15
usage: HBCK2 [OPTIONS] COMMAND <ARGS>
Options:
-d,--debug run with debug output
-i, --inputfiles take one or more files to read the args from

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nick is suggesting this @clarax

Suggested change
-i, --inputfiles take one or more files to read the args from
-i, --inputFiles take one or more files to read the args from

-d,--debug run with debug output
-i, --inputfiles take one or more files to read the args from
-h,--help output this help message
-i,--inputFiles take one or more encoded region names

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate option defined?

If -i or --inputFiles is specified, pass one or more input file names.
Each file contains encoded region names, one per line. For example:
$ HBCK2 assigns -i fileName1 fileName2
$ HBCK2 -i assigns fileName1 fileName2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea here is that "-i" changes how the args are expected by the command so instead of they being listed as on console, the command will accept the file instead but values/format would be different for different commands.

Returns list of extra regions for each table passed as parameter, or
for each table on namespaces specified as parameter.
If -i or --inputFiles is specified, pass one or more input file names.
Each file contains <NAMESPACE|NAMESPACE:TABLENAME>, one per line. For example:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean by either NAMESPACE or NAMESPACE:TABLENAME, as | looks like a part of a format.

Suggested change
Each file contains <NAMESPACE|NAMESPACE:TABLENAME>, one per line. For example:
Each file contains <NAMESPACE or NAMESPACE:TABLENAME>, one per line. For example:

of what a userspace encoded region name looks like. For example:
$ HBCK2 unassign 1588230740 de00010733901a05f5a2a3a382e27dd4
Returns the pid(s) of the created UnassignProcedure(s) or -1 if none.
If -i or --inputFiles is specified, pass one or more input file names.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed , I think we need to define "-i " option well (and remove --inputFiles to avoid confusion), that it just alter the way the args are expected by the command, if "-i" is used and a file is not passed, a user should see an error

OR

your earlier suggestion make it local to every command so that it can be defined as "extraRegionsInMeta -i " instead of global "-i extraRegionsInMeta " .

I think if it is well defined both options are good but we can choose one and proceed, I'm more inclining also towards "local" option as we anyways have to describe them for each command. let me know your thoughts so that we can close on this.


private static void usageScheduleRecoveries(PrintWriter writer) {
writer.println(" " + SCHEDULE_RECOVERIES + " <SERVERNAME>...");
writer.println(" " + SCHEDULE_RECOVERIES + " <SERVERNAME|INPUTFILE_FOR_SERVERNAMES>...");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
writer.println(" " + SCHEDULE_RECOVERIES + " <SERVERNAME|INPUTFILE_FOR_SERVERNAMES>...");
writer.println(" " + SCHEDULE_RECOVERIES + " <Either SERVERNAME OR INPUTFILE_FOR_SERVERNAMES>...");

As HBase expects | in some format like coprocessor so if we can be more descriptive that would be good.


private static void usageUnassigns(PrintWriter writer) {
writer.println(" " + UNASSIGNS + " <ENCODED_REGIONNAME>...");
writer.println(" " + UNASSIGNS + " <ENCODED_REGIONNAME|INPUTFILE_FOR_REGIONNAMES>...");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
writer.println(" " + UNASSIGNS + " <ENCODED_REGIONNAME|INPUTFILE_FOR_REGIONNAMES>...");
writer.println(" " + UNASSIGNS + " <either ENCODED_REGIONNAME or INPUTFILE_FOR_REGIONNAMES>...");

Comment on lines +969 to +991
if (commands.length < 2) {
showErrorMessage(command + " takes a list of file names");
return EXIT_FAILURE;
}
List<String> argList = getFromFiles(Arrays.asList(purgeFirst(commands)));
try (ClusterConnection connection = connect(); Hbck hbck = connection.getHbck()) {
checkFunctionSupported(connection, command);
for (String line : argList) {
String[] args = line.split("\\s+");
System.out.println(setTableState(hbck, args));
}
}
}
try (ClusterConnection connection = connect(); Hbck hbck = connection.getHbck()) {
checkFunctionSupported(connection, command);
System.out.println(setTableState(hbck, TableName.valueOf(commands[1]),
TableState.State.valueOf(commands[2])));
else {
if (commands.length < 3) {
showErrorMessage(SET_TABLE_STATE +
" takes tablename and state arguments: e.g. user ENABLED");
return EXIT_FAILURE;
}
try (ClusterConnection connection = connect(); Hbck hbck = connection.getHbck()) {
checkFunctionSupported(connection, command);
System.out.println(setTableState(hbck, purgeFirst(commands)));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be combined to avoid redundant code?

Comment on lines +1035 to +1056
if (getFromFile) {
if (commands.length < 2) {
showErrorMessage(command + " takes a list of file names");
return EXIT_FAILURE;
}
List<String> argList = getFromFiles(Arrays.asList(purgeFirst(commands)));
try (ClusterConnection connection = connect()) {
checkHBCKSupport(connection, command);
for (String line : argList) {
String[] args = formatSetRegionStateCommand(line.split("\\s+"));
if (setRegionState(connection, args) == EXIT_FAILURE) {
showErrorMessage(command + " failed to set " + args);
}
}
}
break;
} else {
String[] args = formatSetRegionStateCommand(purgeFirst(commands));
try (ClusterConnection connection = connect()) {
checkHBCKSupport(connection, command);
return setRegionState(connection, args);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be combined to avoid redundant code?

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 44s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+0 🆗 spotbugs 0m 0s spotbugs executables are not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
+1 💚 mvninstall 1m 51s master passed
+1 💚 compile 0m 13s master passed
+1 💚 checkstyle 0m 9s master passed
+1 💚 javadoc 0m 9s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 13s the patch passed
+1 💚 compile 0m 11s the patch passed
+1 💚 javac 0m 11s the patch passed
+1 💚 checkstyle 0m 5s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 5s the patch passed
_ Other Tests _
+1 💚 unit 3m 46s hbase-hbck2 in the patch passed.
+1 💚 asflicense 0m 5s The patch does not generate ASF License warnings.
8m 43s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/9/artifact/yetus-precommit-check/output/Dockerfile
GITHUB PR #69
Optional Tests dupname asflicense markdownlint javac javadoc unit spotbugs findbugs checkstyle compile
uname Linux 4b4a91002d64 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 GNU/Linux
Build tool maven
git revision master / b7d9fc8
Default Java Oracle Corporation-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/9/testReport/
Max. process+thread count 1254 (vs. ulimit of 5000)
modules C: hbase-hbck2 U: hbase-hbck2
Console output https://ci-hbase.apache.org/job/HBase-Operator-Tools-PreCommit/job/PR-69/9/console
versions git=2.20.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@clarax
Copy link
Contributor Author

clarax commented Apr 20, 2022

@ankitsinghal @wchevreuil Thank you for the feedbacks. I am closing this PR for the new patch that moves -I to individual command options. Code refactoring and unit tests are added too. Feedbacks are welcome. #105

@clarax clarax closed this Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants