/** * Returns the name to use for coprocessor service calls. For core HBase services * (in the hbase.pb protobuf package), this returns the unqualified name in order to provide * backward compatibility across the package name change. For all other services, * the fully-qualified service name is used. */ public static String getServiceName(Descriptors.ServiceDescriptor service) { if (service.getFullName().startsWith(hbaseServicePackage)) { return service.getName(); } return service.getFullName(); }
TEST_UTIL.startMiniZKCluster(); SecurityInfo.addInfo(AuthenticationProtos.AuthenticationService.getDescriptor().getName(), new SecurityInfo("hbase.test.kerberos.principal", AuthenticationProtos.TokenIdentifier.Kind.HBASE_AUTH_TOKEN));
TEST_UTIL.startMiniZKCluster(); SecurityInfo.addInfo(AuthenticationProtos.AuthenticationService.getDescriptor().getName(), new SecurityInfo("hbase.test.kerberos.principal", AuthenticationProtos.TokenIdentifier.Kind.HBASE_AUTH_TOKEN));
private void generateProtoFromDescriptor(ServiceDescriptor descriptor, Appendable out) throws IOException { out.append("service " + descriptor.getName() + " {\n"); for (MethodDescriptor methodDescriptor : descriptor.getMethods()) { generateProtoFromDescriptor(methodDescriptor, out); } out.append("}\n"); }
@Test public void testServiceName() throws Exception { // verify that we de-namespace build in HBase rpc services Descriptors.ServiceDescriptor authService = AuthenticationProtos.AuthenticationService.getDescriptor(); assertEquals(authService.getName(), CoprocessorRpcUtils.getServiceName(authService)); // non-hbase rpc services should remain fully qualified Descriptors.ServiceDescriptor dummyService = DummyRegionServerEndpointProtos.DummyService.getDescriptor(); assertEquals(dummyService.getFullName(), CoprocessorRpcUtils.getServiceName(dummyService)); } }
public QName getName() { String name; if (serviceBean instanceof com.google.protobuf.Service) { name = ((com.google.protobuf.Service) serviceBean).getDescriptorForType().getName(); } else { name = serviceBean.getClass().getSimpleName(); } return new QName("protobuf", name); }
/** * Returns the name to use for coprocessor service calls. For core HBase services * (in the hbase.pb protobuf package), this returns the unqualified name in order to provide * backward compatibility across the package name change. For all other services, * the fully-qualified service name is used. */ public static String getServiceName(Descriptors.ServiceDescriptor service) { if (service.getFullName().startsWith(hbaseServicePackage)) { return service.getName(); } return service.getFullName(); }
@Test public void testServiceName() throws Exception { // verify that we de-namespace build in HBase rpc services Descriptors.ServiceDescriptor authService = AuthenticationProtos.AuthenticationService.getDescriptor(); assertEquals(authService.getName(), CoprocessorRpcUtils.getServiceName(authService)); // non-hbase rpc services should remain fully qualified Descriptors.ServiceDescriptor dummyService = DummyRegionServerEndpointProtos.DummyService.getDescriptor(); assertEquals(dummyService.getFullName(), CoprocessorRpcUtils.getServiceName(dummyService)); } }
/** * Returns the name to use for coprocessor service calls. For core HBase services * (in the hbase.pb protobuf package), this returns the unqualified name in order to provide * backward compatibility across the package name change. For all other services, * the fully-qualified service name is used. */ public static String getServiceName(Descriptors.ServiceDescriptor service) { if (service.getFullName().startsWith(hbaseServicePackage)) { return service.getName(); } return service.getFullName(); }
public String getName() { return serviceDescriptor.getName(); } }
@Override public Message preEndpointInvocation(ObserverContext<RegionCoprocessorEnvironment> ctx, Service service, String methodName, Message request) throws IOException { // Don't intercept calls to our own AccessControlService, we check for // appropriate permissions in the service handlers if (shouldCheckExecPermission && !(service instanceof AccessControlService)) { requirePermission(ctx, "invoke(" + service.getDescriptorForType().getName() + "." + methodName + ")", getTableName(ctx.getEnvironment()), null, null, Action.EXEC); } return request; }
@Test public void testServiceName() throws Exception { // verify that we de-namespace build in HBase rpc services Descriptors.ServiceDescriptor authService = AuthenticationProtos.AuthenticationService.getDescriptor(); assertEquals(authService.getName(), CoprocessorRpcUtils.getServiceName(authService)); // non-hbase rpc services should remain fully qualified Descriptors.ServiceDescriptor dummyService = DummyRegionServerEndpointProtos.DummyService.getDescriptor(); assertEquals(dummyService.getFullName(), CoprocessorRpcUtils.getServiceName(dummyService)); } }