XComp commented on code in PR #25027:
URL: https://github.com/apache/flink/pull/25027#discussion_r1771347067


##########
flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/cleanup/TestingResourceCleanerFactory.java:
##########
@@ -26,27 +26,42 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.concurrent.Executor;
+import java.util.stream.Collectors;
 
 /** {@code TestingResourceCleanerFactory} for adding custom {@link 
ResourceCleaner} creation. */
 public class TestingResourceCleanerFactory implements ResourceCleanerFactory {
 
     private final Collection<LocallyCleanableResource> 
locallyCleanableResources;
+    private Collection<LocallyCleanableInMainThreadResource> 
locallyCleanableInMainThreadResources;
     private final Collection<GloballyCleanableResource> 
globallyCleanableResources;
 
     private final Executor cleanupExecutor;
 
     private TestingResourceCleanerFactory(
             Collection<LocallyCleanableResource> locallyCleanableResources,
+            Collection<LocallyCleanableInMainThreadResource> 
locallyCleanableInMainThreadResources,
             Collection<GloballyCleanableResource> globallyCleanableResources,
             Executor cleanupExecutor) {
         this.locallyCleanableResources = locallyCleanableResources;
+        this.locallyCleanableInMainThreadResources = 
locallyCleanableInMainThreadResources;
         this.globallyCleanableResources = globallyCleanableResources;
         this.cleanupExecutor = cleanupExecutor;
     }
 
     @Override
     public ResourceCleaner createLocalResourceCleaner(
             ComponentMainThreadExecutor mainThreadExecutor) {
+        Collection<LocallyCleanableResource> locallyCleanableResources =
+                this.locallyCleanableResources;
+
+        locallyCleanableResources.addAll(
+                locallyCleanableInMainThreadResources.stream()
+                        .map(
+                                r ->
+                                        
DispatcherResourceCleanerFactory.toLocallyCleanableResource(

Review Comment:
   yes 👍 



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