DomGarguilo commented on code in PR #4207:
URL: https://github.com/apache/accumulo/pull/4207#discussion_r1478563402


##########
server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java:
##########
@@ -83,13 +85,17 @@ public class GarbageCollectWriteAheadLogs {
     this.fs = fs;
     this.liveServers = liveServers;
     this.walMarker = new WalStateManager(context);
-    this.store = () -> Iterators.concat(
-        context.getAmple().readTablets().forLevel(DataLevel.ROOT).filter(new 
HasWalsFilter())
-            .fetch(LOCATION, LAST, LOGS, PREV_ROW, SUSPEND).build().iterator(),
-        
context.getAmple().readTablets().forLevel(DataLevel.METADATA).filter(new 
HasWalsFilter())
-            .fetch(LOCATION, LAST, LOGS, PREV_ROW, SUSPEND).build().iterator(),
-        context.getAmple().readTablets().forLevel(DataLevel.USER).filter(new 
HasWalsFilter())
-            .fetch(LOCATION, LAST, LOGS, PREV_ROW, 
SUSPEND).build().iterator());
+    TabletsMetadata root = 
context.getAmple().readTablets().forLevel(DataLevel.ROOT)
+        .filter(new HasWalsFilter()).fetch(LOCATION, LAST, LOGS, PREV_ROW, 
SUSPEND).build();
+    TabletsMetadata metadata = 
context.getAmple().readTablets().forLevel(DataLevel.METADATA)
+        .filter(new HasWalsFilter()).fetch(LOCATION, LAST, LOGS, PREV_ROW, 
SUSPEND).build();
+    TabletsMetadata user = 
context.getAmple().readTablets().forLevel(DataLevel.USER)
+        .filter(new HasWalsFilter()).fetch(LOCATION, LAST, LOGS, PREV_ROW, 
SUSPEND).build();
+    this.store = Streams.concat(root.stream(), metadata.stream(), 
user.stream()).onClose(() -> {

Review Comment:
   From what I can tell each time a `GarbageCollectWriteAheadLogs` object is 
created, it is used to call `collect` just once (which eventually iterates over 
the `store`) but it does not seem like it is ever reused. Is your concern with 
if collect was called again on the same `GarbageCollectWriteAheadLogs` object? 
Is that something we want to allow for? If we don't see the need to ever allow 
that to happen we could add some sort of check to make sure its only called 
once in which case it seems like it might be fine to keep things how they are. 
I may be thinking about this wrong though



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