You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2019/09/05 23:18:12 UTC

[hbase-operator-tools] 01/02: HBASE-22825 [HBCK2] Add a client-side to hbase-operator-tools that can exploit fixMeta added in server side Fix review comments - Put FixMeta alphabetically Signed-off-by: Sean Busbey Signed-off-by: stack

This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-operator-tools.git

commit 49f4af2bf0a9f884036382ca12e5475ac17e185e
Author: Sakthi <sa...@apache.org>
AuthorDate: Thu Sep 5 15:41:36 2019 -0700

    HBASE-22825 [HBCK2] Add a client-side to hbase-operator-tools that can exploit fixMeta added in server side Fix review comments - Put FixMeta alphabetically Signed-off-by: Sean Busbey <bu...@apache.org> Signed-off-by: stack <st...@apache.org>
---
 hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java | 18 ++++++++++++++++++
 pom.xml                                               |  2 +-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java b/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
index cbc6184..60e8e29 100644
--- a/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
+++ b/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
@@ -88,6 +88,8 @@ public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
   private static final String VERSION = "version";
   private static final String SET_REGION_STATE = "setRegionState";
   private static final String SCHEDULE_RECOVERIES = "scheduleRecoveries";
+  private static final String FIX_META = "fixMeta";
+
   private Configuration conf;
   static String [] MINIMUM_HBCK2_VERSION = {"2.0.3", "2.1.1", "2.2.0", "3.0.0"};
   private boolean skipCheck = false;
@@ -306,6 +308,9 @@ public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
     writer.println("   restores 'hbase.version' if missing. Interacts with the filesystem");
     writer.println("   only! Modified regions need to be reopened to pick-up changes.");
     writer.println();
+    writer.println(" " + FIX_META);
+    writer.println("   Do a server-side fixing of bad or inconsistent state in hbase:meta");
+    writer.println();
     writer.println(" " + REPLICATION + " [OPTIONS] [<TABLENAME>...]");
     writer.println("   Options:");
     writer.println("    -f, --fix    fix any replication issues found.");
@@ -586,6 +591,19 @@ public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
         }
         break;
 
+      case FIX_META:
+        if (commands.length > 1) {
+          usage(options, command + " doesn't take any arguments");
+          return EXIT_FAILURE;
+        }
+        try (ClusterConnection connection = connect(); Hbck hbck = connection.getHbck()) {
+          checkHBCKSupport(connection, command, "2.0.6", "2.1.6", "2.2.1", "2.3.0",
+              "3.0.0");
+          hbck.fixMeta();
+          System.out.println("Server-side processing of fixMeta triggered.");
+        }
+        break;
+
       default:
         showErrorMessage("Unsupported command: " + command);
         return EXIT_FAILURE;
diff --git a/pom.xml b/pom.xml
index d44db75..2860880 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,7 +123,7 @@
     <compileSource>1.8</compileSource>
     <java.min.version>${compileSource}</java.min.version>
     <maven.min.version>3.3.3</maven.min.version>
-    <hbase.version>2.1.2</hbase.version>
+    <hbase.version>2.1.6</hbase.version>
     <maven.compiler.version>3.6.1</maven.compiler.version>
     <surefire.version>2.21.0</surefire.version>
     <surefire.provider>surefire-junit47</surefire.provider>