You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ps...@apache.org on 2019/09/13 07:03:29 UTC
[hbase-operator-tools] branch master updated: HBASE-23018 - [HBCK2]
Add useful messages when report/fixing missing regions in meta (#31)
This is an automated email from the ASF dual-hosted git repository.
psomogyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-operator-tools.git
The following commit(s) were added to refs/heads/master by this push:
new ec8188b HBASE-23018 - [HBCK2] Add useful messages when report/fixing missing regions in meta (#31)
ec8188b is described below
commit ec8188b3ebcd0a19739129a53e02a32cd96ca68f
Author: Dice <po...@gmail.com>
AuthorDate: Fri Sep 13 16:03:24 2019 +0900
HBASE-23018 - [HBCK2] Add useful messages when report/fixing missing regions in meta (#31)
Signed-off-by: Michael Stack <st...@apache.org>
---
hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
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 23048cd..62693ba 100644
--- a/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
+++ b/hbase-hbck2/src/main/java/org/apache/hbase/HBCK2.java
@@ -219,6 +219,13 @@ public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
try(ClusterConnection conn = connect();
final Admin admin = conn.getAdmin()) {
Map<TableName,List<Path>> report = reportTablesWithMissingRegionsInMeta(nameSpaceOrTable);
+ if(report.size() < 1) {
+ LOG.info("\nNo missing regions in meta are found. Worth using " +
+ "reportMissingRegionsInMeta first.\nYou are likely passing non-existent " +
+ "namespace or table. Note that table names should include the namespace " +
+ "portion even for tables in the default namespace. " +
+ "See also the command usage.\n");
+ }
for (TableName tableName : report.keySet()) {
if(admin.tableExists(tableName)) {
futures.add(executorService.submit(new Callable<List<String>>() {
@@ -786,6 +793,12 @@ public class HBCK2 extends Configured implements org.apache.hadoop.util.Tool {
private String formatMissingRegionsInMetaReport(Map<TableName,List<Path>> report) {
final StringBuilder builder = new StringBuilder();
+ if(report.size() < 1) {
+ builder.append("\nNo reports are found. You are likely passing non-existent " +
+ "namespace or table. Note that table names should include the namespace " +
+ "portion even for tables in the default namespace. See also the command usage.\n");
+ return builder.toString();
+ }
builder.append("Missing Regions for each table:\n\t");
report.keySet().stream().forEach(table -> {
builder.append(table);