Class ExecutorServiceUtil
java.lang.Object
org.apache.drill.exec.util.concurrent.ExecutorServiceUtil
Utility class to enhance the Java
ExecutorService
class functionality-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Executor task wrapper to enhance task cancellation behavior -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Future<T>
submit
(ExecutorService service, Callable<T> callable) Helper method to submit the callabale task, gets the original future object, and wrap it in another future object with the ability to decorate theFuture.cancel(boolean)
method; this decorator will block when future cancellation is invoked (and the "mayInterruptIfRunning" parameter is set to true).
-
Method Details
-
submit
Helper method to submit the callabale task, gets the original future object, and wrap it in another future object with the ability to decorate theFuture.cancel(boolean)
method; this decorator will block when future cancellation is invoked (and the "mayInterruptIfRunning" parameter is set to true).- Parameters:
service
- the executor servicecallable
- a callable task- Returns:
- decorated future object upon successful submission
-