keith-turner commented on code in PR #2792:
URL: https://github.com/apache/accumulo/pull/2792#discussion_r974622546


##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -171,8 +179,40 @@ public Stream<Reference> getReferences() {
   }
 
   @Override
-  public Set<TableId> getTableIDs() {
-    return context.getTableIdToNameMap().keySet();
+  public Map<TableId,TableState> getTableIDs() throws InterruptedException {
+    final String tablesPath = context.getZooKeeperRoot() + Constants.ZTABLES;
+    final ZooReader zr = context.getZooReader();
+    int retries = 1;
+    UncheckedIOException ioe = null;
+    while (retries <= 10) {
+      try {
+        zr.sync(tablesPath);
+        final Map<TableId,TableState> tids = new HashMap<>();
+        for (String table : zr.getChildren(tablesPath)) {
+          TableId tableId = TableId.of(table);
+          TableState tableState = null;
+          String statePath = context.getZooKeeperRoot() + Constants.ZTABLES + 
"/"
+              + tableId.canonical() + Constants.ZTABLE_STATE;
+          byte[] state = zr.getData(statePath, null, null);

Review Comment:
   I think Zookeeper will create the more specific versions of the exception 
based on the error code.   So you can catch those.  Looked at the ZK source a 
bit and found the following.
   
   
https://github.com/apache/zookeeper/blob/9b6ec9060604347fc996fe69dc33a21222fbd0c4/zookeeper-server/src/main/java/org/apache/zookeeper/ZooKeeper.java#L2028
   
   
   
https://github.com/apache/zookeeper/blob/9b6ec9060604347fc996fe69dc33a21222fbd0c4/zookeeper-server/src/main/java/org/apache/zookeeper/KeeperException.java#L93



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