keith-turner commented on a change in pull request #2293:
URL: https://github.com/apache/accumulo/pull/2293#discussion_r719577111



##########
File path: 
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java
##########
@@ -217,11 +222,30 @@ private void confirmDeletes(GarbageCollectionEnvironment 
gce,
         throw new RuntimeException(
             "Scanner over metadata table returned unexpected column : " + 
entry.getKey());
     }
+    Set<String> tableIdsAfter = gce.getTableIDs();
+    ensureAllTablesChecked(tableIdsBefore, tableIdsSeen, tableIdsAfter);
 
     confirmDeletesFromReplication(gce.getReplicationNeededIterator(),
         candidateMap.entrySet().iterator());
   }
 
+  @VisibleForTesting
+  protected void ensureAllTablesChecked(Set<String> tableIdsBefore, 
Set<String> tableIdsSeen,

Review comment:
       This is protected and marked vis for testing, but does not seem to be 
used in a test.  Is there a test change that was not checked in?

##########
File path: 
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionAlgorithm.java
##########
@@ -172,18 +173,22 @@ private void confirmDeletes(GarbageCollectionEnvironment 
gce,
 
     }
 
+    Set<String> tableIdsBefore = gce.getTableIDs();
+    Set<String> tableIdsSeen = new HashSet<>();
     Iterator<Entry<Key,Value>> iter = gce.getReferenceIterator();
     while (iter.hasNext()) {
       Entry<Key,Value> entry = iter.next();
       Key key = entry.getKey();
       Text cft = key.getColumnFamily();
+      tableIdsSeen.add(new String(KeyExtent.tableOfMetadataRow(key.getRow())));
 
       if (cft.equals(DataFileColumnFamily.NAME) || 
cft.equals(ScanFileColumnFamily.NAME)) {
         String cq = key.getColumnQualifier().toString();
 
         String reference = cq;
         if (cq.startsWith("/")) {
           String tableID = new 
String(KeyExtent.tableOfMetadataRow(key.getRow()));
+          tableIdsSeen.add(tableID);

Review comment:
       Seems like the code is deriving the table id from the row multiple times 
and adding it (or is there some little diff I am missing?).  May be able to do 
the following.  
   
   ```suggestion
         String tableID = new 
String(KeyExtent.tableOfMetadataRow(key.getRow()));
         tableIdsSeen.add(tableID);
   
         if (cft.equals(DataFileColumnFamily.NAME) || 
cft.equals(ScanFileColumnFamily.NAME)) {
           String cq = key.getColumnQualifier().toString();
   
           String reference = cq;
           if (cq.startsWith("/")) {
   ```




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