wchevreuil commented on a change in pull request #69:
URL:
https://github.com/apache/hbase-operator-tools/pull/69#discussion_r442869982
##########
File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
##########
@@ -203,8 +204,8 @@ int setRegionState(ClusterConnection connection, String
region,
Map<TableName,List<Path>> report;
try (final FsRegionsMetaRecoverer fsRegionsMetaRecoverer =
new FsRegionsMetaRecoverer(this.conf)) {
- report = fsRegionsMetaRecoverer.reportTablesMissingRegions(
- formatNameSpaceTableParam(nameSpaceOrTable));
+ report =
fsRegionsMetaRecoverer.reportTablesMissingRegions(getFromArgsOrFiles(
Review comment:
Missing UT and updates to `reportMissingRegionsInMeta` command
description (as it now accepts list of files)
##########
File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
##########
@@ -297,21 +292,8 @@ int setRegionState(ClusterConnection connection, String
region,
return null;
}
boolean overrideFlag = commandLine.hasOption(override.getOpt());
-
List<String> argList = commandLine.getArgList();
- if (!commandLine.hasOption(inputFile.getOpt())) {
- return hbck.assigns(argList, overrideFlag);
- }
- List<String> assignmentList = new ArrayList<>();
- for (String filePath : argList) {
- try (InputStream fileStream = new FileInputStream(filePath)){
- LineIterator it = IOUtils.lineIterator(fileStream, "UTF-8");
- while (it.hasNext()) {
- assignmentList.add(it.nextLine().trim());
- }
- }
- }
- return hbck.assigns(assignmentList, overrideFlag);
+ return hbck.assigns(this.getFromArgsOrFiles(argList), overrideFlag);
Review comment:
Missing UT and updates to `setRegionState` command description (as it
now accepts list of files)
##########
File path: hbase-hbck2/README.md
##########
@@ -280,6 +281,9 @@ Command:
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.
Review comment:
We should modify the command params description on line #274 to:
`unassigns <ENCODED_REGIONNAME|-i INPUT_FILES>`
##########
File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
##########
@@ -265,16 +266,12 @@ int setRegionState(ClusterConnection connection, String
region,
return result;
}
- private List<String> formatNameSpaceTableParam(String... nameSpaceOrTable) {
- return nameSpaceOrTable != null ? Arrays.asList(nameSpaceOrTable) : null;
- }
-
List<Future<List<String>>> addMissingRegionsInMetaForTables(String...
nameSpaceOrTable) throws IOException {
try (final FsRegionsMetaRecoverer fsRegionsMetaRecoverer =
new FsRegionsMetaRecoverer(this.conf)) {
- return fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(
- formatNameSpaceTableParam(nameSpaceOrTable));
+ return
fsRegionsMetaRecoverer.addMissingRegionsInMetaForTables(getFromArgsOrFiles(
Review comment:
Missing UT and updates to `addFsRegionsMissingInMeta` command
description (as it now accepts list of files)
##########
File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
##########
@@ -228,7 +229,7 @@ int setRegionState(ClusterConnection connection, String
region,
Map<TableName, List<String>> result = new HashMap<>();
try (final FsRegionsMetaRecoverer fsRegionsMetaRecoverer =
new FsRegionsMetaRecoverer(this.conf)) {
- List<String> namespacesTables =
formatNameSpaceTableParam(commandLine.getArgs());
+ List<String> namespacesTables =
getFromArgsOrFiles(formatNameSpaceTableParam(commandLine.getArgs()));
Review comment:
Missing UT and updates to `extraRegionsInMeta` command description (as
it now accepts list of files)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]