Interface AsyncChecker<K,V>

All Known Implementing Classes:
ThrottledAsyncChecker

@Private @Unstable public interface AsyncChecker<K,V>
A class that can be used to schedule an asynchronous check on a given Checkable. If the check is successfully scheduled then a ListenableFuture is returned.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<V>>
    schedule(Checkable<K,V> target, K context)
    Schedule an asynchronous check for the given object.
    void
    shutdownAndWait(long timeout, TimeUnit timeUnit)
    Cancel all executing checks and wait for them to complete.
  • Method Details

    • schedule

      Optional<org.apache.hadoop.thirdparty.com.google.common.util.concurrent.ListenableFuture<V>> schedule(Checkable<K,V> target, K context)
      Schedule an asynchronous check for the given object.
      Parameters:
      target - object to be checked.
      context - the interpretation of the context depends on the target.
      Returns:
      returns a of ListenableFuture that can be used to retrieve the result of the asynchronous check.
    • shutdownAndWait

      void shutdownAndWait(long timeout, TimeUnit timeUnit) throws InterruptedException
      Cancel all executing checks and wait for them to complete. First attempts a graceful cancellation, then cancels forcefully. Waits for the supplied timeout after both attempts. See ExecutorService.awaitTermination(long, java.util.concurrent.TimeUnit) for a description of the parameters.
      Throws:
      InterruptedException