You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/07/02 22:56:01 UTC

[GitHub] [hbase-operator-tools] saintstack commented on a change in pull request #3: Hbase 22567

saintstack commented on a change in pull request #3: Hbase 22567
URL: https://github.com/apache/hbase-operator-tools/pull/3#discussion_r299702674
 
 

 ##########
 File path: hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
 ##########
 @@ -164,6 +177,128 @@ int setRegionState(String region, RegionState.State newState)
     return EXIT_FAILURE;
   }
 
+  Map<String,List<Path>> reportTablesWithMissingRegionsInMeta(String... nameSpaceOrTable)
+      throws Exception {
+    final StringBuilder builder = new StringBuilder();
+    Map<String,List<Path>> report;
+    try(final MetaFixer metaFixer = new MetaFixer(this.conf)){
+      List<String> names = nameSpaceOrTable != null ? Arrays.asList(nameSpaceOrTable) : null;
+      report = metaFixer.reportTablesMissingRegions(names);
+      builder.append("Missing Regions for each table:\n\t");
+      report.keySet().stream().forEach(table -> {
+        builder.append(table);
+        if (report.get(table).size()>0){
+          builder.append("->\n\t\t");
+          report.get(table).stream().forEach(region -> builder.append(region.getName())
+            .append(" "));
+        } else {
+          builder.append(" -> No missing regions");
+        }
+        builder.append("\n\t");
+      });
+    } catch (Exception e) {
+      LOG.error("Error reporting missing regions: ", e);
+      throw e;
+    }
+    System.out.println(builder);
 
 Review comment:
   Trying to avoid the output being all spew like it is when hbck1 runs. It is intimidating/frightening in hbck1.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services