dlmarion commented on code in PR #2792:
URL: https://github.com/apache/accumulo/pull/2792#discussion_r957281388


##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -167,7 +172,20 @@ public Stream<Reference> getReferences() {
 
   @Override
   public Set<TableId> getTableIDs() {
-    return context.getTableIdToNameMap().keySet();
+    final String tablesPath = context.getZooKeeperRoot() + Constants.ZTABLES;
+    final ZooReader zr = context.getZooReader();
+    final Set<TableId> tids = new HashSet<>();
+    while (true) {
+      try {
+        zr.sync(tablesPath);
+        zr.getChildren(tablesPath).forEach(t -> tids.add(TableId.of(t)));
+        return tids;
+      } catch (KeeperException | InterruptedException e) {
+        log.error("Error getting tables from ZooKeeper, retrying", e);
+        UtilWaitThread.sleepUninterruptibly(1, TimeUnit.SECONDS);
+        continue;

Review Comment:
   Addressed in c4e0ab918bf002c83d4200af67df0578aff44e73



##########
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectionEnvironment.java:
##########
@@ -72,6 +72,29 @@ public interface GarbageCollectionEnvironment {
    */
   Stream<Reference> getReferences();
 
+  /**
+   * Return true if this for the RootTable, usually setup in the constructor
+   *
+   * @return true if the GCE is for the RootTable
+   */
+  boolean isRootTable();
+
+  /**
+   * Return true if this for the MetadataTable, usually setup in the 
constructor
+   *
+   * @return true if the GCE is for the MetadataTable
+   */
+  boolean isMetadataTable();
+
+  /**
+   * Return a list of TableIDs for which we are considering deletes. For the 
root table this would
+   * be the metadata table. For the metadata table, this would be all of the 
other tables in the

Review Comment:
   Addressed in c4e0ab918bf002c83d4200af67df0578aff44e73



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