HBASE-12302 VisibilityClient getAuths does not propagate remote service exception correctly (Jerry He)

This commit is contained in:
Ted Yu 2014-10-21 20:09:14 +00:00
parent 3306679a68
commit 89191230ea
2 changed files with 16 additions and 4 deletions

View File

@ -92,7 +92,11 @@ public class VisibilityClient {
}
}
service.addLabels(controller, builder.build(), rpcCallback);
return rpcCallback.get();
VisibilityLabelsResponse response = rpcCallback.get();
if (controller.failedOnException()) {
throw controller.getFailedOn();
}
return response;
}
};
Map<byte[], VisibilityLabelsResponse> result = ht.coprocessorService(
@ -140,7 +144,11 @@ public class VisibilityClient {
GetAuthsRequest.Builder getAuthReqBuilder = GetAuthsRequest.newBuilder();
getAuthReqBuilder.setUser(ByteStringer.wrap(Bytes.toBytes(user)));
service.getAuths(controller, getAuthReqBuilder.build(), rpcCallback);
return rpcCallback.get();
GetAuthsResponse response = rpcCallback.get();
if (controller.failedOnException()) {
throw controller.getFailedOn();
}
return response;
}
};
Map<byte[], GetAuthsResponse> result = ht.coprocessorService(VisibilityLabelsService.class,
@ -191,7 +199,11 @@ public class VisibilityClient {
} else {
service.clearAuths(controller, setAuthReqBuilder.build(), rpcCallback);
}
return rpcCallback.get();
VisibilityLabelsResponse response = rpcCallback.get();
if (controller.failedOnException()) {
throw controller.getFailedOn();
}
return response;
}
};
Map<byte[], VisibilityLabelsResponse> result = ht.coprocessorService(

View File

@ -740,7 +740,7 @@ public class VisibilityController extends BaseMasterAndRegionObserver implements
User requestingUser = VisibilityUtils.getActiveUser();
throw new AccessDeniedException("User '"
+ (requestingUser != null ? requestingUser.getShortName() : "null")
+ " is not authorized to perform this action.");
+ "' is not authorized to perform this action.");
}
labels = this.visibilityLabelService.getAuths(user, false);
} catch (IOException e) {