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


##########
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:
   I took the suggested approach in 8212985. 
   
   I then thought of the idea to make getters for the things we want to inject 
from the test, that way we dont have to create the store in the constructor and 
can more cleanly close the resources without having to make the object 
autoclosable. This approach was taken in bd4e81a. Let me know which approach 
looks better.



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