/** * 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(); }
TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) { if (tableName == null) { throw new IllegalArgumentException("Given table name is null"); } this.tableName = tableName; this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout() : connConf.getOperationTimeout(); this.rpcTimeout = connConf.getRpcTimeout(); this.readRpcTimeout = connConf.getReadRpcTimeout(); this.writeRpcTimeout = connConf.getWriteRpcTimeout(); }
@Override protected Message callExecService(final RpcController controller, final Descriptors.MethodDescriptor method, final Message request, final Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } // Try-with-resources so close gets called when we are done. try (MasterCallable<CoprocessorServiceResponse> callable = new MasterCallable<CoprocessorServiceResponse>(connection, connection.getRpcControllerFactory()) { @Override protected CoprocessorServiceResponse rpcCall() throws Exception { CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); return this.master.execMasterService(getRpcController(), csr); } }) { // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller callable.prepare(false); int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); CoprocessorServiceResponse result = callable.call(operationTimeout); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } } };
public static <R> void doBatchWithCallback(List<? extends Row> actions, Object[] results, Callback<R> callback, ClusterConnection connection, ExecutorService pool, TableName tableName) throws InterruptedIOException, RetriesExhaustedWithDetailsException { int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); int writeTimeout = connection.getConfiguration().getInt(HConstants.HBASE_RPC_WRITE_TIMEOUT_KEY, connection.getConfiguration().getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT)); AsyncProcessTask<R> task = AsyncProcessTask.newBuilder(callback) .setPool(pool) .setTableName(tableName) .setRowAccess(actions) .setResults(results) .setOperationTimeout(operationTimeout) .setRpcTimeout(writeTimeout) .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL) .build(); AsyncRequestFuture ars = connection.getAsyncProcess().submit(task); ars.waitUntilDone(); if (ars.hasError()) { throw ars.getErrors(); } }
Object[] results = new Object[2]; int operationTimeout = ((ClusterConnection) HTU.getConnection()).getConnectionConfiguration().getOperationTimeout(); int readTimeout = ((ClusterConnection) HTU.getConnection()).getConnectionConfiguration().getReadRpcTimeout(); AsyncProcessTask task = AsyncProcessTask.newBuilder()
params.getOperationTimeout() : conn.getConnectionConfiguration().getOperationTimeout()); this.ap = ap;
.setRowAccess(ops) .setSubmittedRows(AsyncProcessTask.SubmittedRows.AT_LEAST_ONE) .setOperationTimeout(conn.getConnectionConfiguration().getOperationTimeout()) .setRpcTimeout(60 * 1000) .build();
/** * 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(); }
TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) { if (tableName == null) { throw new IllegalArgumentException("Given table name is null"); } this.tableName = tableName; this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout() : connConf.getOperationTimeout(); this.rpcTimeout = connConf.getRpcTimeout(); this.readRpcTimeout = connConf.getReadRpcTimeout(); this.writeRpcTimeout = connConf.getWriteRpcTimeout(); }
@Override protected Message callExecService(final RpcController controller, final Descriptors.MethodDescriptor method, final Message request, final Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } // Try-with-resources so close gets called when we are done. try (MasterCallable<CoprocessorServiceResponse> callable = new MasterCallable<CoprocessorServiceResponse>(connection, connection.getRpcControllerFactory()) { @Override protected CoprocessorServiceResponse rpcCall() throws Exception { CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); return this.master.execMasterService(getRpcController(), csr); } }) { // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller callable.prepare(false); int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); CoprocessorServiceResponse result = callable.call(operationTimeout); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } } };
public static <R> void doBatchWithCallback(List<? extends Row> actions, Object[] results, Callback<R> callback, ClusterConnection connection, ExecutorService pool, TableName tableName) throws InterruptedIOException, RetriesExhaustedWithDetailsException { int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); int writeTimeout = connection.getConfiguration().getInt(HConstants.HBASE_RPC_WRITE_TIMEOUT_KEY, connection.getConfiguration().getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT)); AsyncProcessTask<R> task = AsyncProcessTask.newBuilder(callback) .setPool(pool) .setTableName(tableName) .setRowAccess(actions) .setResults(results) .setOperationTimeout(operationTimeout) .setRpcTimeout(writeTimeout) .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL) .build(); AsyncRequestFuture ars = connection.getAsyncProcess().submit(task); ars.waitUntilDone(); if (ars.hasError()) { throw ars.getErrors(); } }
params.getOperationTimeout() : conn.getConnectionConfiguration().getOperationTimeout()); this.ap = ap;
/** * 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(); }
TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) { if (tableName == null) { throw new IllegalArgumentException("Given table name is null"); } this.tableName = tableName; this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout() : connConf.getOperationTimeout(); this.rpcTimeout = connConf.getRpcTimeout(); this.readRpcTimeout = connConf.getReadRpcTimeout(); this.writeRpcTimeout = connConf.getWriteRpcTimeout(); }
@Override protected Message callExecService(final RpcController controller, final Descriptors.MethodDescriptor method, final Message request, final Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } // Try-with-resources so close gets called when we are done. try (MasterCallable<CoprocessorServiceResponse> callable = new MasterCallable<CoprocessorServiceResponse>(connection, connection.getRpcControllerFactory()) { @Override protected CoprocessorServiceResponse rpcCall() throws Exception { CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); return this.master.execMasterService(getRpcController(), csr); } }) { // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller callable.prepare(false); int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); CoprocessorServiceResponse result = callable.call(operationTimeout); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } } };
public static <R> void doBatchWithCallback(List<? extends Row> actions, Object[] results, Callback<R> callback, ClusterConnection connection, ExecutorService pool, TableName tableName) throws InterruptedIOException, RetriesExhaustedWithDetailsException { int operationTimeout = connection.getConnectionConfiguration().getOperationTimeout(); int writeTimeout = connection.getConfiguration().getInt(HConstants.HBASE_RPC_WRITE_TIMEOUT_KEY, connection.getConfiguration().getInt(HConstants.HBASE_RPC_TIMEOUT_KEY, HConstants.DEFAULT_HBASE_RPC_TIMEOUT)); AsyncProcessTask<R> task = AsyncProcessTask.newBuilder(callback) .setPool(pool) .setTableName(tableName) .setRowAccess(actions) .setResults(results) .setOperationTimeout(operationTimeout) .setRpcTimeout(writeTimeout) .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL) .build(); AsyncRequestFuture ars = connection.getAsyncProcess().submit(task); ars.waitUntilDone(); if (ars.hasError()) { throw ars.getErrors(); } }
Object[] results = new Object[2]; int operationTimeout = ((ClusterConnection) HTU.getConnection()).getConnectionConfiguration().getOperationTimeout(); int readTimeout = ((ClusterConnection) HTU.getConnection()).getConnectionConfiguration().getReadRpcTimeout(); AsyncProcessTask task = AsyncProcessTask.newBuilder()
params.getOperationTimeout() : conn.getConnectionConfiguration().getOperationTimeout()); this.ap = ap;
.setRowAccess(ops) .setSubmittedRows(AsyncProcessTask.SubmittedRows.AT_LEAST_ONE) .setOperationTimeout(conn.getConnectionConfiguration().getOperationTimeout()) .setRpcTimeout(60 * 1000) .build();