kumar-mallikarjuna commented on code in PR #25027:
URL: https://github.com/apache/flink/pull/25027#discussion_r1771262937
##########
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:
I didn't get this. By internally you mean have a
`toLocallyCleanableResource` method in `TestingResourceCleanerFactory`?
--
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]