kumar-mallikarjuna commented on code in PR #25027:
URL: https://github.com/apache/flink/pull/25027#discussion_r1771603366
##########
flink-runtime/src/main/java/org/apache/flink/runtime/dispatcher/cleanup/DispatcherResourceCleanerFactory.java:
##########
@@ -124,10 +127,39 @@ JOB_MANAGER_METRIC_GROUP_LABEL,
ofLocalResource(jobManagerMetricGroup))
* state when we terminate globally.
*
* @param localResource Local resource that we want to clean during a
global cleanup.
+ * @param mainThreadExecutor Main thread executor for cleanup.
* @return Globally cleanable resource.
*/
- private static GloballyCleanableResource ofLocalResource(
+ private static GloballyCleanableResource toGloballyCleanableResource(
+ LocallyCleanableInMainThreadResource localResource,
+ ComponentMainThreadExecutor mainThreadExecutor) {
+ return (jobId, cleanupExecutor) ->
+ localResource.localCleanupAsync(jobId, cleanupExecutor,
mainThreadExecutor);
+ }
+
+ /**
+ * A simple wrapper for the resources that don't have any artifacts that
can outlive the {@link
+ * org.apache.flink.runtime.dispatcher.Dispatcher}, but we still want to
clean up their local
+ * state when we terminate globally.
+ *
+ * @param localResource Local resource that we want to clean during a
global cleanup.
+ * @return Globally cleanable resource.
+ */
+ private static GloballyCleanableResource toGloballyCleanableResource(
LocallyCleanableResource localResource) {
return localResource::localCleanupAsync;
}
+
+ /**
+ * Converts a LocallyCleanableInMainThreadResource object to a
LocallyCleanableResource object.
+ *
+ * @param localResource LocallyCleanableInMainThreadResource that we want
to translate.
+ * @return A LocallyCleanableResource.
+ */
+ public static LocallyCleanableResource toLocallyCleanableResource(
Review Comment:
Removed this method in favour of a default method in
`LocallyCleanableResourceWithMainThread`.
--
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]