Class Retryer
java.lang.Object
org.apache.hadoop.fs.impl.prefetch.Retryer
Provides retry related functionality.
-
Constructor Summary
ConstructorsConstructorDescriptionRetryer(int perRetryDelay, int maxDelay, int statusUpdateInterval) Initializes a new instance of theRetryerclass. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if retrying should continue, false otherwise.booleanReturns true if status update interval has been reached.
-
Constructor Details
-
Retryer
public Retryer(int perRetryDelay, int maxDelay, int statusUpdateInterval) Initializes a new instance of theRetryerclass.- Parameters:
perRetryDelay- per retry delay (in ms).maxDelay- maximum amount of delay (in ms) before retry fails.statusUpdateInterval- time interval (in ms) at which status update would be made.- Throws:
IllegalArgumentException- if perRetryDelay is zero or negative.IllegalArgumentException- if maxDelay is less than or equal to perRetryDelay.IllegalArgumentException- if statusUpdateInterval is zero or negative.
-
-
Method Details
-
continueRetry
public boolean continueRetry()Returns true if retrying should continue, false otherwise.- Returns:
- true if the caller should retry, false otherwise.
-
updateStatus
public boolean updateStatus()Returns true if status update interval has been reached.- Returns:
- true if status update interval has been reached.
-