/** * 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(); }
final ServiceDescriptor serviceDescriptor = fileDescriptor.getServices().stream() .filter(sd -> sd.getFullName().equals( service.getServiceDescriptor().getName())) .findFirst()
.setServiceName(exec.getMethod().getService().getFullName()) .setMethodName(exec.getMethod().getName()) .setRequest(value)));
private String getFullMethodName() { String serviceName = protoMethodDescriptor.getService().getFullName(); String methodName = protoMethodDescriptor.getName(); return generateFullMethodName(serviceName, methodName); }
synchronized void unregisterBlockingService(BlockingService service) { if (!blockingServiceMap.containsKey(service.getDescriptorForType().getFullName())) { throw new IllegalArgumentException("BlockingService not already registered"); } blockingServiceMap.remove(service.getDescriptorForType().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)); } }
public static MethodDescriptor getMethodDescriptor(final String methodName, final ServiceDescriptor serviceDesc) throws UnknownProtocolException { Descriptors.MethodDescriptor methodDesc = serviceDesc.findMethodByName(methodName); if (methodDesc == null) { throw new UnknownProtocolException("Unknown method " + methodName + " called on service " + serviceDesc.getFullName()); } return methodDesc; }
/** * 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(); }
synchronized void registerBlockingService(BlockingService service) { if (blockingServiceMap.containsKey(service.getDescriptorForType().getFullName())) { throw new IllegalArgumentException("BlockingService already registered"); } blockingServiceMap.put(service.getDescriptorForType().getFullName(), service); }
@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)); } }
.setServiceName(exec.getMethod().getService().getFullName()) .setMethodName(exec.getMethod().getName()) .setRequest(value)));
.setServiceName(exec.getMethod().getService().getFullName()) .setMethodName(exec.getMethod().getName()) .setRequest(value)));
/** * 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 static MethodDescriptor getMethodDescriptor(final String methodName, final ServiceDescriptor serviceDesc) throws UnknownProtocolException { Descriptors.MethodDescriptor methodDesc = serviceDesc.findMethodByName(methodName); if (methodDesc == null) { throw new UnknownProtocolException("Unknown method " + methodName + " called on service " + serviceDesc.getFullName()); } return methodDesc; }
.setServiceName(exec.getMethod().getService().getFullName()) .setMethodName(exec.getMethod().getName()) .setRequest(value)));
String name() { return service.getFullName(); }
private MethodDescriptor(final MethodDescriptorProto proto, final FileDescriptor file, final ServiceDescriptor parent, final int index) throws DescriptorValidationException { this.index = index; this.proto = proto; this.file = file; service = parent; fullName = parent.getFullName() + '.' + proto.getName(); file.pool.addSymbol(this); }
private MethodDescriptor(final MethodDescriptorProto proto, final FileDescriptor file, final ServiceDescriptor parent, final int index) throws DescriptorValidationException { this.index = index; this.proto = proto; this.file = file; service = parent; fullName = parent.getFullName() + '.' + proto.getName(); file.pool.addSymbol(this); }
@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 static MethodDescriptor getMethodDescriptor(final String methodName, final ServiceDescriptor serviceDesc) throws UnknownProtocolException { Descriptors.MethodDescriptor methodDesc = serviceDesc.findMethodByName(methodName); if (methodDesc == null) { throw new UnknownProtocolException("Unknown method " + methodName + " called on service " + serviceDesc.getFullName()); } return methodDesc; }