public class PDErrorHandler<RespT> extends Object implements ErrorHandler<RespT>
Modifier and Type | Field and Description |
---|---|
static Function<Pdpb.GetRegionResponse,PDError> |
getRegionResponseErrorExtractor |
Constructor and Description |
---|
PDErrorHandler(Function<RespT,PDError> errorExtractor,
PDClient client) |
Modifier and Type | Method and Description |
---|---|
boolean |
handleRequestError(BackOffer backOffer,
Exception e)
Handle the error received during a calling process before it could return a normal response.
|
boolean |
handleResponseError(BackOffer backOffer,
RespT resp)
Handle the error received in the response after a calling process completes.
|
public static final Function<Pdpb.GetRegionResponse,PDError> getRegionResponseErrorExtractor
public boolean handleResponseError(BackOffer backOffer, RespT resp)
ErrorHandler
handleResponseError
in interface ErrorHandler<RespT>
backOffer
- Back offer used for retryresp
- the response to handlepublic boolean handleRequestError(BackOffer backOffer, Exception e)
ErrorHandler
handleRequestError
in interface ErrorHandler<RespT>
backOffer
- Back offer used for retrye
- Exception received during a calling processCopyright © 2024 PingCAP. All rights reserved.