Details
Description
Alok reported seeing the following exception when subclass of class which implements CoprocessorService is used for hbase.coprocessor.region.classes :
hbase(main):015:0> grant 'mktg1', 'RWC', 'iemployee' ERROR: org.apache.hadoop.hbase.exceptions.UnknownProtocolException: No registered coprocessor service found for name AccessControlService in region hbase:acl,,1437137157604.2daf735ea38da95e9ba249db6b63b79c. at org.apache.hadoop.hbase.regionserver.HRegion.execService(HRegion.java:7367) at org.apache.hadoop.hbase.regionserver.RSRpcServices.execServiceOnRegion(RSRpcServices.java:1873) at org.apache.hadoop.hbase.regionserver.RSRpcServices.execService(RSRpcServices.java:1855) at org.apache.hadoop.hbase.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:32209) at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2112) at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101) at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130) at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
The root cause is in the following code of RegionCoprocessorHost:
for (Class<?> c : implClass.getInterfaces()) { if (CoprocessorService.class.isAssignableFrom(c)) { region.registerService( ((CoprocessorService)instance).getService() ); } }
We currently only check the interfaces directly implemented by the underlying class.
What should be done is to check all the interfaces implemented by class itself and its superclasses.