Class Canceler

java.lang.Object
org.apache.hadoop.hdfs.util.Canceler

@Private public class Canceler extends Object
Provides a simple interface where one thread can mark an operation for cancellation, and another thread can poll for whether the cancellation has occurred.
  • Constructor Details

    • Canceler

      public Canceler()
  • Method Details

    • cancel

      public void cancel(String reason)
      Requests that the current operation be canceled if it is still running. This does not block until the cancellation is successful.
      Parameters:
      reason - the reason why cancellation is requested
    • isCancelled

      public boolean isCancelled()
    • getCancellationReason

      public String getCancellationReason()