Search in sources :

Example 1 with ServiceDescriptor

use of org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.ServiceDescriptor in project hbase by apache.

the class RpcServerFactory method createRpcServer.

public static RpcServer createRpcServer(final Server server, final String name, final List<BlockingServiceAndInterface> services, final InetSocketAddress bindAddress, Configuration conf, RpcScheduler scheduler) throws IOException {
    String rpcServerClass = conf.get(CUSTOM_RPC_SERVER_IMPL_CONF_KEY, SimpleRpcServer.class.getName());
    StringBuffer servicesList = new StringBuffer();
    for (BlockingServiceAndInterface s : services) {
        ServiceDescriptor sd = s.getBlockingService().getDescriptorForType();
        // Can be null for certain tests like TestTokenAuthentication
        if (sd == null)
            continue;
        if (servicesList.length() > 0)
            servicesList.append(", ");
        servicesList.append(sd.getFullName());
    }
    LOG.info("Creating " + rpcServerClass + " hosting " + servicesList);
    return ReflectionUtils.instantiateWithCustomCtor(rpcServerClass, new Class[] { Server.class, String.class, List.class, InetSocketAddress.class, Configuration.class, RpcScheduler.class }, new Object[] { server, name, services, bindAddress, conf, scheduler });
}
Also used : BlockingServiceAndInterface(org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface) ServiceDescriptor(org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.ServiceDescriptor)

Aggregations

BlockingServiceAndInterface (org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface)1 ServiceDescriptor (org.apache.hadoop.hbase.shaded.com.google.protobuf.Descriptors.ServiceDescriptor)1