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



##########
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:
       > Is there any way that I would easily be able to recreate this error in 
testing?
   
   You could put the `Tables.getTableName` in a different method, and then do a 
partial mock or subclass this utility to provide a different response. However, 
it's not critical. Just wrapping `Tables.getTableName` with a try-catch block 
and setting tableName to null if there's an exception should be sufficient, as 
long as none of the rest of the code minds it being null.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to