GJL commented on a change in pull request #9268: [FLINK-13452] Ensure to fail
global when exception happens during reseting tasks of regions
URL: https://github.com/apache/flink/pull/9268#discussion_r310575939
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
##########
@@ -189,6 +189,42 @@
scheduledExecutor);
}
+ /**
+ * Schedule the operation with given delay.
+ *
+ * @param operation to schedule
+ * @param delay delay to schedule
+ * @param scheduledExecutor executor to be used for the operation
+ * @param <T> type of the result
+ * @return Future which schedule the given operation with given delay.
+ */
+ public static <T> CompletableFuture<T> scheduleAsync(
Review comment:
I think we should add the following overload:
```
public static CompletableFuture<Void> scheduleWithDelay(
final Runnable operation,
final Time delay,
final ScheduledExecutor scheduledExecutor) {
Supplier<Void> operationSupplier = () -> {
operation.run();
return null;
};
return scheduleWithDelay(operationSupplier, delay,
scheduledExecutor);
}
```
This will reduce in the `RestartStrategy` implementations.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services