HBASE-12302 VisibilityClient getAuths does not propagate remote service exception correctly (Jerry He)
This commit is contained in:
parent
5d1e9a32a4
commit
6c70f4f7f7
|
@ -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(
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue