You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/06/24 16:51:27 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #2180: Update CheckForMetadataProblems Utility Output

ctubbsii commented on a change in pull request #2180:
URL: https://github.com/apache/accumulo/pull/2180#discussion_r658119653



##########
File path: server/base/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java
##########
@@ -125,7 +128,12 @@ private static void checkMetadataAndRootTableEntries(String tableNameToCheck, Se
         TreeSet<KeyExtent> tablets = tables.get(tableId);
         if (tablets == null) {
 
-          tables.forEach(CheckForMetadataProblems::checkTable);
+          for (Entry<TableId,TreeSet<KeyExtent>> e : tables.entrySet()) {
+            TableId key = e.getKey();
+            TreeSet<KeyExtent> value = e.getValue();
+            String tableName = Tables.getTableName(opts.getServerContext(), key);
+            checkTable(key, value, tableName);
+          }

Review comment:
       I think this line could have stayed the same and the name lookup could have occurred in the method. Also, need to handle the case that looking up the name fails, in case the table is deleted, but there is still metadata left in the metadata tablet. That wasn't an issue before because we only used the table ID before.

##########
File path: server/base/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java
##########
@@ -90,19 +92,20 @@ private static void checkTable(TableId tableId, TreeSet<KeyExtent> tablets) {
       lastEndRow = tabke.endRow();
     }
     if (everythingLooksGood)
-      System.out.println("All is well for table " + tableId);
+      System.out.println("...All is well for table " + tableName + " (" + tableId + ")");
     else
       sawProblems = true;
   }
 
   private static void checkMetadataAndRootTableEntries(String tableNameToCheck, ServerUtilOpts opts)
       throws Exception {
-    System.out.println("Checking table: " + tableNameToCheck);
+    TableId tableCheckId = Tables.getTableId(opts.getServerContext(), tableNameToCheck);
+    System.out.println("Checking tables whos metadata is found in: " + tableNameToCheck + " ("

Review comment:
       ```suggestion
       System.out.println("Checking tables whose metadata is found in: " + tableNameToCheck + " ("
   ```

##########
File path: server/base/src/main/java/org/apache/accumulo/server/util/CheckForMetadataProblems.java
##########
@@ -90,19 +92,20 @@ private static void checkTable(TableId tableId, TreeSet<KeyExtent> tablets) {
       lastEndRow = tabke.endRow();
     }
     if (everythingLooksGood)
-      System.out.println("All is well for table " + tableId);
+      System.out.println("...All is well for table " + tableName + " (" + tableId + ")");

Review comment:
       If these "All is well" messages are indented with `...`, then the error messages should also be.




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