Package org.apache.druid.rpc.indexing
Class SpecificTaskRetryPolicy
java.lang.Object
org.apache.druid.rpc.indexing.SpecificTaskRetryPolicy
- All Implemented Interfaces:
ServiceRetryPolicy
Retry policy for tasks. Meant to be used together with
SpecificTaskServiceLocator.
Returns true from retryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse) when encountering an HTTP 400 or HTTP 404 with a
ChatHandlerResource.TASK_ID_HEADER header for a different task. This can happen when a task is suspended and
then later restored in a different location, and then some *other* task reuses its old port. This task-mismatch
scenario is retried indefinitely, since we expect that the SpecificTaskServiceLocator will update the
location at some point.-
Field Summary
Fields inherited from interface org.apache.druid.rpc.ServiceRetryPolicy
UNLIMITED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the maximum number of desired attempts, orServiceRetryPolicy.UNLIMITEDif unlimited.longReturns the maximum wait time between retries.longReturns the minimum wait time between retries.booleanretryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse response) Returns whether the given HTTP response can be retried.booleanReturns whether to log the cause of failure before retryingbooleanReturns whether service-not-available, i.e.booleanReturns whether the given exception can be retried.
-
Constructor Details
-
SpecificTaskRetryPolicy
-
-
Method Details
-
maxAttempts
public long maxAttempts()Description copied from interface:ServiceRetryPolicyReturns the maximum number of desired attempts, orServiceRetryPolicy.UNLIMITEDif unlimited. A value of 1 means no retries. Zero is invalid.- Specified by:
maxAttemptsin interfaceServiceRetryPolicy
-
minWaitMillis
public long minWaitMillis()Description copied from interface:ServiceRetryPolicyReturns the minimum wait time between retries.- Specified by:
minWaitMillisin interfaceServiceRetryPolicy
-
maxWaitMillis
public long maxWaitMillis()Description copied from interface:ServiceRetryPolicyReturns the maximum wait time between retries.- Specified by:
maxWaitMillisin interfaceServiceRetryPolicy
-
retryHttpResponse
public boolean retryHttpResponse(org.jboss.netty.handler.codec.http.HttpResponse response) Description copied from interface:ServiceRetryPolicyReturns whether the given HTTP response can be retried. The response will have a non-2xx error code.- Specified by:
retryHttpResponsein interfaceServiceRetryPolicy
-
retryThrowable
Description copied from interface:ServiceRetryPolicyReturns whether the given exception can be retried.- Specified by:
retryThrowablein interfaceServiceRetryPolicy
-
retryLoggable
public boolean retryLoggable()Description copied from interface:ServiceRetryPolicyReturns whether to log the cause of failure before retrying- Specified by:
retryLoggablein interfaceServiceRetryPolicy
-
retryNotAvailable
public boolean retryNotAvailable()Description copied from interface:ServiceRetryPolicyReturns whether service-not-available, i.e. emptyServiceLocations.getLocations(), can be retried.- Specified by:
retryNotAvailablein interfaceServiceRetryPolicy
-