wchevreuil commented on a change in pull request #86:
URL: 
https://github.com/apache/hbase-operator-tools/pull/86#discussion_r630976284



##########
File path: 
hbase-tools/src/main/java/org/apache/hbase/RegionsOnUnknownServersRecoverer.java
##########
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hbase;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.hbase.HBaseConfiguration;
+import org.apache.hadoop.hbase.client.Connection;
+import org.apache.hadoop.hbase.client.ConnectionFactory;
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Tool for identifying Unknown Servers from master logs and schedule SCPs for 
each of those using
+ * HBCK2 'scheduleRecoveries' option. This is useful for clusters running 
hbase versions lower than
+ * 2.2.7, 2.3.5 and 2.4.7. For any of these versions or higher, use HBCK2 
'recoverUnknown' option.
+ */
+public class RegionsOnUnknownServersRecoverer extends Configured implements 
Tool {
+
+  private static final Logger LOG =
+    LoggerFactory.getLogger(RegionsOnUnknownServersRecoverer.class.getName());
+
+  private static final String CATALOG_JANITOR = "CatalogJanitor: hole=";
+
+  private static final String UNKNOWN_SERVER = "unknown_server=";
+
+  private Configuration conf;
+
+  private Set<String> unknownServers = new HashSet<>();
+
+  private boolean dryRun = false;
+
+  public RegionsOnUnknownServersRecoverer(Configuration conf){
+    this.conf = conf;
+  }
+
+  @Override
+  public int run(String[] args) throws Exception {
+    String logPath = null;
+    if(args.length>=1 && args.length<3) {
+      logPath = args[0];
+      if(args.length==2) {
+        dryRun = Boolean.parseBoolean(args[1]);
+      }
+    } else {
+      LOG.error("Wrong number of arguments. "
+        + "Arguments are: <PATH_TO_MASTER_LOGS> [dryRun]");

Review comment:
       Just wanted to mention the available options here. I guess we can 
explain the `dryRun` option in the README only?




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


Reply via email to