Skip to content
Permalink
Browse files
HBASE-23018 - [HBCK2] Add useful messages when report/fixing missing …
…regions in meta (#31)

Signed-off-by: Michael Stack <stack@apache.org>
  • Loading branch information
daisukebe authored and petersomogyi committed Sep 13, 2019
1 parent f6d071a commit ec8188b3ebcd0a19739129a53e02a32cd96ca68f
Showing 1 changed file with 13 additions and 0 deletions.
@@ -219,6 +219,13 @@ Pair<List<String>, List<ExecutionException>> addMissingRegionsInMetaForTables(St
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 @@ private static String toString(List<?> things) {

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);

0 comments on commit ec8188b

Please sign in to comment.