Java 类org.apache.hadoop.hbase.client.ConnectionUtils 实例源码

项目:ditb    文件:HRegionServer.java   
/**
 * Create a 'smarter' HConnection, one that is capable of by-passing RPC if the request is to
 * the local server. Safe to use going to local or remote server.
 * Create this instance in a method can be intercepted and mocked in tests.
 *
 * @throws IOException
 */
@VisibleForTesting protected ClusterConnection createClusterConnection() throws IOException {
  // Create a cluster connection that when appropriate, can short-circuit and go directly to the
  // local server if the request is to the local server bypassing RPC. Can be used for both local
  // and remote invocations.
  return ConnectionUtils
      .createShortCircuitConnection(conf, null, userProvider.getCurrent(), serverName,
          rpcServices, rpcServices);
}
项目:pbase    文件:HRegionServer.java   
/**
 * Create a 'smarter' HConnection, one that is capable of by-passing RPC if the request is to
 * the local server.  Safe to use going to local or remote server.
 * Create this instance in a method can be intercepted and mocked in tests.
 *
 * @throws IOException
 */
@VisibleForTesting
protected ClusterConnection createClusterConnection() throws IOException {
    // Create a cluster connection that when appropriate, can short-circuit and go directly to the
    // local server if the request is to the local server bypassing RPC. Can be used for both local
    // and remote invocations.
    return ConnectionUtils.createShortCircuitHConnection(
            ConnectionFactory.createConnection(conf), serverName, rpcServices, rpcServices);
}
项目:hbase    文件:HRegionServer.java   
/**
 * Create a 'smarter' Connection, one that is capable of by-passing RPC if the request is to
 * the local server; i.e. a short-circuit Connection. Safe to use going to local or remote
 * server. Create this instance in a method can be intercepted and mocked in tests.
 * @throws IOException
 */
@VisibleForTesting
protected ClusterConnection createClusterConnection() throws IOException {
  // Create a cluster connection that when appropriate, can short-circuit and go directly to the
  // local server if the request is to the local server bypassing RPC. Can be used for both local
  // and remote invocations.
  return ConnectionUtils.createShortCircuitConnection(conf, null, userProvider.getCurrent(),
    serverName, rpcServices, rpcServices);
}
项目:spliceengine    文件:MemstoreAwareObserver.java   
public static void main(String...args) throws Exception {
    long timeWaited = 0l;
    for (int i = 1; i <= 40; i++) {
        timeWaited += ConnectionUtils.getPauseTime(90, i);
    }
    System.out.printf("timeWaited: %d sec%n", timeWaited);
}
项目:hbase    文件:HRegionServer.java   
@Override
public Connection createConnection(Configuration conf) throws IOException {
  User user = UserProvider.instantiate(conf).getCurrent();
  return ConnectionUtils.createShortCircuitConnection(conf, null, user, this.serverName,
      this.rpcServices, this.rpcServices);
}
项目:hbase    文件:FanOutOneBlockAsyncDFSOutputHelper.java   
static void sleepIgnoreInterrupt(int retry) {
  try {
    Thread.sleep(ConnectionUtils.getPauseTime(100, retry));
  } catch (InterruptedException e) {
  }
}
项目:hbase    文件:TestCoprocessorShortCircuitRPC.java   
private static void checkShortCircuit(Connection connection) {
  assertTrue(connection instanceof ConnectionUtils.ShortCircuitingClusterConnection);
}
项目:PyroDB    文件:HRegionServer.java   
/**
 * Create CatalogTracker.
 * In its own method so can intercept and mock it over in tests.
 * @throws IOException
 */
protected CatalogTracker createCatalogTracker() throws IOException {
  HConnection conn = ConnectionUtils.createShortCircuitHConnection(
    HConnectionManager.getConnection(conf), serverName, rpcServices, rpcServices);
  return new CatalogTracker(zooKeeper, conf, conn, this);
}