HBaseAdmin(ClusterConnection connection) throws IOException { this.conf = connection.getConfiguration(); this.connection = connection; // TODO: receive ConnectionConfiguration here rather than re-parsing these configs every time. this.pause = this.conf.getLong(HConstants.HBASE_CLIENT_PAUSE, HConstants.DEFAULT_HBASE_CLIENT_PAUSE); this.numRetries = this.conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); this.operationTimeout = this.conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT); this.rpcTimeout = this.conf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); this.syncWaitTimeout = this.conf.getInt( "hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min this.getProcedureTimeout = this.conf.getInt("hbase.client.procedure.future.get.timeout.msec", 10 * 60000); // 10min this.rpcCallerFactory = connection.getRpcRetryingCallerFactory(); this.rpcControllerFactory = connection.getRpcControllerFactory(); this.ng = this.connection.getNonceGenerator(); }
/** * Constructor * @param conn connection to use * @param table to connect to * @param row to locate region with */ RegionCoprocessorRpcChannel(ClusterConnection conn, TableName table, byte[] row) { this.table = table; this.row = row; this.conn = conn; this.operationTimeout = conn.getConnectionConfiguration().getOperationTimeout(); this.rpcCallerFactory = conn.getRpcRetryingCallerFactory(); }
Mockito.when(connection.getRpcRetryingCallerFactory()).thenReturn(callerFactory);
/** * See {@link #getMasterQuotaStates(Connection, RpcControllerFactory, RpcRetryingCallerFactory, int)} */ public static GetQuotaStatesResponse getMasterQuotaStates( ClusterConnection clusterConn, int timeout) throws IOException { RpcControllerFactory rpcController = clusterConn.getRpcControllerFactory(); RpcRetryingCallerFactory rpcCaller = clusterConn.getRpcRetryingCallerFactory(); return getMasterQuotaStates(clusterConn, rpcController, rpcCaller, timeout); }
/** * See {@link #getMasterRegionSizes(Connection, RpcControllerFactory, RpcRetryingCallerFactory, int)} */ public static GetSpaceQuotaRegionSizesResponse getMasterRegionSizes( ClusterConnection clusterConn, int timeout) throws IOException { RpcControllerFactory rpcController = clusterConn.getRpcControllerFactory(); RpcRetryingCallerFactory rpcCaller = clusterConn.getRpcRetryingCallerFactory(); return getMasterRegionSizes(clusterConn, rpcController, rpcCaller, timeout); }
HBaseAdmin(ClusterConnection connection) throws IOException { this.conf = connection.getConfiguration(); this.connection = connection; // TODO: receive ConnectionConfiguration here rather than re-parsing these configs every time. this.pause = this.conf.getLong(HConstants.HBASE_CLIENT_PAUSE, HConstants.DEFAULT_HBASE_CLIENT_PAUSE); this.numRetries = this.conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); this.operationTimeout = this.conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT); this.rpcTimeout = this.conf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); this.syncWaitTimeout = this.conf.getInt( "hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min this.rpcCallerFactory = connection.getRpcRetryingCallerFactory(); this.rpcControllerFactory = connection.getRpcControllerFactory(); this.ng = this.connection.getNonceGenerator(); }
/** * Constructor * @param conn connection to use * @param table to connect to * @param row to locate region with */ RegionCoprocessorRpcChannel(ClusterConnection conn, TableName table, byte[] row) { this.table = table; this.row = row; this.conn = conn; this.operationTimeout = conn.getConnectionConfiguration().getOperationTimeout(); this.rpcCallerFactory = conn.getRpcRetryingCallerFactory(); }
/** * See {@link #getMasterRegionSizes(Connection, RpcControllerFactory, RpcRetryingCallerFactory, int)} */ public static GetSpaceQuotaRegionSizesResponse getMasterRegionSizes( ClusterConnection clusterConn, int timeout) throws IOException { RpcControllerFactory rpcController = clusterConn.getRpcControllerFactory(); RpcRetryingCallerFactory rpcCaller = clusterConn.getRpcRetryingCallerFactory(); return getMasterRegionSizes(clusterConn, rpcController, rpcCaller, timeout); }
/** * See {@link #getMasterQuotaStates(Connection, RpcControllerFactory, RpcRetryingCallerFactory, int)} */ public static GetQuotaStatesResponse getMasterQuotaStates( ClusterConnection clusterConn, int timeout) throws IOException { RpcControllerFactory rpcController = clusterConn.getRpcControllerFactory(); RpcRetryingCallerFactory rpcCaller = clusterConn.getRpcRetryingCallerFactory(); return getMasterQuotaStates(clusterConn, rpcController, rpcCaller, timeout); }
/** * Constructor * @param conn connection to use * @param table to connect to * @param row to locate region with */ RegionCoprocessorRpcChannel(ClusterConnection conn, TableName table, byte[] row) { this.table = table; this.row = row; this.conn = conn; this.operationTimeout = conn.getConnectionConfiguration().getOperationTimeout(); this.rpcCallerFactory = conn.getRpcRetryingCallerFactory(); }
HBaseAdmin(ClusterConnection connection) throws IOException { this.conf = connection.getConfiguration(); this.connection = connection; // TODO: receive ConnectionConfiguration here rather than re-parsing these configs every time. this.pause = this.conf.getLong(HConstants.HBASE_CLIENT_PAUSE, HConstants.DEFAULT_HBASE_CLIENT_PAUSE); this.numRetries = this.conf.getInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, HConstants.DEFAULT_HBASE_CLIENT_RETRIES_NUMBER); this.operationTimeout = this.conf.getInt(HConstants.HBASE_CLIENT_OPERATION_TIMEOUT, HConstants.DEFAULT_HBASE_CLIENT_OPERATION_TIMEOUT); this.rpcTimeout = this.conf.getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT); this.syncWaitTimeout = this.conf.getInt( "hbase.client.sync.wait.timeout.msec", 10 * 60000); // 10min this.rpcCallerFactory = connection.getRpcRetryingCallerFactory(); this.rpcControllerFactory = connection.getRpcControllerFactory(); this.ng = this.connection.getNonceGenerator(); }
Mockito.when(connection.getRpcRetryingCallerFactory()).thenReturn(callerFactory);