org.apache.hadoop.hbase.regionserver.RpcSchedulerFactory Java Examples

The following examples show how to use org.apache.hadoop.hbase.regionserver.RpcSchedulerFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MasterRpcServices.java    From hbase with Apache License 2.0 6 votes vote down vote up
@Override
protected RpcServerInterface createRpcServer(final Server server,
    final RpcSchedulerFactory rpcSchedulerFactory, final InetSocketAddress bindAddress,
    final String name) throws IOException {
  final Configuration conf = regionServer.getConfiguration();
  // RpcServer at HM by default enable ByteBufferPool iff HM having user table region in it
  boolean reservoirEnabled = conf.getBoolean(ByteBuffAllocator.ALLOCATOR_POOL_ENABLED_KEY,
    LoadBalancer.isMasterCanHostUserRegions(conf));
  try {
    return RpcServerFactory.createRpcServer(server, name, getServices(),
        bindAddress, // use final bindAddress for this server.
        conf, rpcSchedulerFactory.create(conf, this, server), reservoirEnabled);
  } catch (BindException be) {
    throw new IOException(be.getMessage() + ". To switch ports use the '"
        + HConstants.MASTER_PORT + "' configuration property.",
        be.getCause() != null ? be.getCause() : be);
  }
}
 
Example #2
Source File: TestAsyncClientPauseForCallQueueTooBig.java    From hbase with Apache License 2.0 5 votes vote down vote up
@BeforeClass
public static void setUp() throws Exception {
  UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_PAUSE, 10);
  UTIL.getConfiguration().setLong(HConstants.HBASE_CLIENT_PAUSE_FOR_CQTBE,
    TimeUnit.NANOSECONDS.toMillis(PAUSE_FOR_CQTBE_NS));
  UTIL.getConfiguration().setClass(RSRpcServices.REGION_SERVER_RPC_SCHEDULER_FACTORY_CLASS,
    CQTBERpcSchedulerFactory.class, RpcSchedulerFactory.class);
  UTIL.startMiniCluster(1);
  CONN = ConnectionFactory.createAsyncConnection(UTIL.getConfiguration()).get();
}