Class FutureUtils

org.elasticsearch.common.util.concurrent.FutureUtils

public class FutureUtils extends
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    <?> toCancel)
    Cancel execution of this future without interrupting a running thread.
    static <T> T
    <T> future)
    Calls without the checked exceptions.
    static <T> T
    <T> future, long timeout,  unit)
    Calls without the checked exceptions.
    static
     e)
     

    Methods inherited from class java.lang.

    , , , , , , , , , ,
  • Constructor Details

    • FutureUtils

      public FutureUtils()
  • Method Details

    • cancel

      public static boolean cancel(@Nullable <?> toCancel)
      Cancel execution of this future without interrupting a running thread. See for details.
      Parameters:
      toCancel - the future to cancel
      Returns:
      false if the future could not be cancelled, otherwise true
    • get

      public static <T> T get(<T> future)
      Calls without the checked exceptions.
      Type Parameters:
      T - the type returned
      Parameters:
      future - to dereference
      Returns:
      the value of the future
    • get

      public static <T> T get(<T> future, long timeout,  unit)
      Calls without the checked exceptions.
      Type Parameters:
      T - the type returned
      Parameters:
      future - to dereference
      timeout - to wait
      unit - for timeout
      Returns:
      the value of the future
    • rethrowExecutionException

      public static  rethrowExecutionException( e)