Package org.apache.hadoop.hdfs.util
Class Canceler
java.lang.Object
org.apache.hadoop.hdfs.util.Canceler
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRequests that the current operation be canceled if it is still running.boolean
-
Constructor Details
-
Canceler
public Canceler()
-
-
Method Details
-
cancel
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
-