MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / call

Method call

src/RegionClient.java:866–899  ·  view source on GitHub ↗
(final Object resp)

Source from the content-addressed store, hash-verified

864 private void addMultiActionCallbacks(final MultiAction request) {
865 final class MultiActionCallback implements Callback<Object, Object> {
866 public Object call(final Object resp) {
867 if (!(resp instanceof MultiAction.Response)) {
868 if (resp instanceof BatchableRpc) { // Single-RPC multi-action?
869 return null; // Yes, nothing to do. See multiActionToSingleAction.
870 } else if (resp instanceof Exception) {
871 return handleException((Exception) resp);
872 }
873 throw new InvalidResponseException(MultiAction.Response.class, resp);
874 }
875 final MultiAction.Response response = (MultiAction.Response) resp;
876 final ArrayList<BatchableRpc> batch = request.batch();
877 final int n = batch.size();
878 for (int i = 0; i < n; i++) {
879 final BatchableRpc rpc = batch.get(i);
880 final Object r = response.result(i);
881 if (r instanceof RecoverableException) {
882 if (r instanceof NotServingRegionException) {
883 // We need to do NSRE handling here too, as the response might
884 // have come back successful, but only some parts of the batch
885 // could have encountered an NSRE.
886 hbase_client.handleNSRE(rpc, rpc.getRegion().name(),
887 (NotServingRegionException) r);
888 } else {
889 retryEdit(rpc, (RecoverableException) r);
890 }
891 } else {
892 rpc.callback(r);
893 }
894 }
895 // We're successful. If there was a problem, the exception was
896 // delivered to the specific RPCs that failed, and they will be
897 // responsible for retrying.
898 return null;
899 }
900
901 private Object handleException(final Exception e) {
902 if (!(e instanceof RecoverableException)) {

Callers

nothing calls this directly

Calls 10

handleExceptionMethod · 0.95
batchMethod · 0.80
resultMethod · 0.80
handleNSREMethod · 0.80
retryEditMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
getRegionMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected