clarax commented on code in PR #105:
URL:
https://github.com/apache/hbase-operator-tools/pull/105#discussion_r846584100
##########
hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java:
##########
@@ -196,6 +227,43 @@ int setRegionState(ClusterConnection connection, String
region,
return setRegionState(connection, region, 0, newState);
}
+ int setRegionState(ClusterConnection connection, String[] args) throws
IOException {
+ Options options = new Options();
+ Option inputFile = Option.builder("i").longOpt("inputFiles").build();
+ options.addOption(inputFile);
+ CommandLine commandLine = getCommandLine(args, options);
+ if (commandLine == null) {
+ return EXIT_FAILURE;
+ }
+ String[] argList = commandLine.getArgs();
+ if (argList == null) {
+ return EXIT_FAILURE;
+ }
+
+ if(!commandLine.hasOption(inputFile.getOpt())) {
+ String[] params = formatSetRegionStateCommand(argList);
+ return setRegionStateByArgs(connection, params);
+ } else {
+ List<String> inputList = getFromArgsOrFiles(stringArrayToList(argList),
true);
+ for (String line : inputList) {
+ String[] params = formatSetRegionStateCommand(line.split("\\s+"));
Review Comment:
same as above
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]