@InterfaceAudience.Private abstract class RetryingCallerInterceptor extends Object
PreemptiveFastFailInterceptor
Example use case :
try {
interceptor.intercept
doAction()
} catch (Exception e) {
interceptor.handleFailure
} finally {
interceptor.updateFaulireInfo
}
The RetryingCallerInterceptor
also acts as a factory
for getting a new RetryingCallerInterceptorContext
.Modifier | Constructor and Description |
---|---|
protected |
RetryingCallerInterceptor() |
Modifier and Type | Method and Description |
---|---|
abstract RetryingCallerInterceptorContext |
createEmptyContext()
This returns the context object for the current call.
|
abstract void |
handleFailure(RetryingCallerInterceptorContext context,
Throwable t)
Call this function in case we caught a failure during retries.
|
abstract void |
intercept(RetryingCallerInterceptorContext abstractRetryingCallerInterceptorContext)
Call this function alongside the actual call done on the callable.
|
abstract String |
toString() |
abstract void |
updateFailureInfo(RetryingCallerInterceptorContext context)
Call this function to update at the end of the retry.
|
public abstract RetryingCallerInterceptorContext createEmptyContext()
public abstract void handleFailure(RetryingCallerInterceptorContext context, Throwable t) throws IOException
context
- : The context object that we obtained previously.t
- : The exception that we caught in this particular tryIOException
public abstract void intercept(RetryingCallerInterceptorContext abstractRetryingCallerInterceptorContext) throws IOException
abstractRetryingCallerInterceptorContext
- PreemptiveFastFailException
IOException
public abstract void updateFailureInfo(RetryingCallerInterceptorContext context)
context
- Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.