mjwall commented on a change in pull request #2293:
URL: https://github.com/apache/accumulo/pull/2293#discussion_r732119374



##########
File path: 
server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
##########
@@ -130,7 +136,31 @@ public Value addDirReference(String tableId, String 
endRow, String dir) {
     }
 
     public Value removeDirReference(String tableId, String endRow) {
-      return references.remove(newDirReferenceKey(tableId, endRow));
+      Value retVal = references.remove(newDirReferenceKey(tableId, endRow));
+      removeDanglingTableIds(tableId);
+      return retVal;
+    }
+
+    /*
+     * this is to be called from removeDirReference or removeFileReference.
+     *
+     * If you just removed the last reference to a table, we need to remove it 
from
+     * the tableIds in zookeeper
+     */
+    private void removeDanglingTableIds(String tableId) {
+      for(Entry<Key, Value> entry : references.entrySet()) {
+        // check table id from row
+        // TODO: check table ids referenced in dir in || clause
+        if (entry.getKey().getRow().toString().equals(tableId)) {

Review comment:
       the intent is to remove tableids from the list of tablesIDs in the 
TestGCE because existing tests are now breaking with the added checks.  going 
to rework this, will look at your method.
   




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