keith-turner commented on code in PR #2792:
URL: https://github.com/apache/accumulo/pull/2792#discussion_r969615888
##########
server/gc/src/main/java/org/apache/accumulo/gc/GCRun.java:
##########
@@ -172,7 +177,19 @@ 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);
+ }
+ }
Review Comment:
> The existing code that uses it may not be correct for metadata and root
levels
Actually the existing code that uses it is probably correct if the current
impl returns all table ids including root and metadata tables which I think it
would as long as those are in ZK. Limiting it to returning just the table ids
for the current level should not harm the current usage.
--
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]