keith-turner commented on a change in pull request #2552:
URL: https://github.com/apache/accumulo/pull/2552#discussion_r821906945



##########
File path: 
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
##########
@@ -754,14 +754,9 @@ public void run() {
     mincMetrics = new TabletServerMinCMetrics();
     ceMetrics = new CompactionExecutorsMetrics();
     MetricsUtil.initializeProducers(metrics, updateMetrics, scanMetrics, 
mincMetrics, ceMetrics);
-
-    this.compactionManager = new CompactionManager(new Iterable<Compactable>() 
{
-      @Override
-      public Iterator<Compactable> iterator() {
-        return 
Iterators.transform(onlineTablets.snapshot().values().iterator(),
-            Tablet::asCompactable);
-      }
-    }, getContext(), ceMetrics);
+    var tabletIterator = onlineTablets.snapshot().values().iterator();
+    Iterable<Compactable> compactables = () -> transform(tabletIterator, 
Tablet::asCompactable);

Review comment:
       > Good catch. I don't see how yours is any different though.
   
   In the change I made I think `onlineTablets.snapshot().values().iterator()` 
is executed each time the lambda is called.




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