Class ExecutorServiceUtil

java.lang.Object
org.apache.drill.exec.util.concurrent.ExecutorServiceUtil

public final class ExecutorServiceUtil extends Object
Utility class to enhance the Java ExecutorService class functionality
  • Method Details

    • submit

      public static <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 the Future.cancel(boolean) method; this decorator will block when future cancellation is invoked (and the "mayInterruptIfRunning" parameter is set to true).
      Parameters:
      service - the executor service
      callable - a callable task
      Returns:
      decorated future object upon successful submission