Package org.apache.hadoop.hbase.client
Class RetryingCallerInterceptor
java.lang.Object
org.apache.hadoop.hbase.client.RetryingCallerInterceptor
- Direct Known Subclasses:
NoOpRetryableCallerInterceptor
,PreemptiveFastFailInterceptor
This class is designed to fit into the RetryingCaller class which forms the central piece of
intelligence for the client side retries for most calls. One can extend this class and intercept
the RetryingCaller and add additional logic into the execution of a simple HTable operations like
get, delete etc. Concrete implementations of this calls are supposed to the thread safe. The
object is used across threads to identify the fast failing threads. For a concrete use case see
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
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract RetryingCallerInterceptorContext
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
Call this function to update at the end of the retry.
-
Constructor Details
-
RetryingCallerInterceptor
protected RetryingCallerInterceptor()
-
-
Method Details
-
createEmptyContext
This returns the context object for the current call.- Returns:
- context : the context that needs to be used during this call.
-
handleFailure
public abstract void handleFailure(RetryingCallerInterceptorContext context, Throwable t) throws IOException Call this function in case we caught a failure during retries. : The context object that we obtained previously. : The exception that we caught in this particular try- Throws:
IOException
-
intercept
public abstract void intercept(RetryingCallerInterceptorContext abstractRetryingCallerInterceptorContext) throws IOException Call this function alongside the actual call done on the callable.- Throws:
IOException
-
updateFailureInfo
Call this function to update at the end of the retry. This is not necessary to happen. -
toString
-