/** * Create a callable. Isolated to be easily overridden in the tests. */ private MultiServerCallable createCallable(final ServerName server, TableName tableName, final MultiAction multi) { return new MultiServerCallable(asyncProcess.connection, tableName, server, multi, asyncProcess.rpcFactory.newController(), rpcTimeout, tracker, multi.getPriority()); }
@Override public void prepare(boolean reload) throws IOException { // Use the location we were given in the constructor rather than go look it up. setStub(getConnection().getClient(this.location.getServerName())); }
setRpcControllerCellScanner(CellUtil.createCellScanner(cells)); ClientProtos.MultiResponse responseProto = getStub().multi(getRpcController(), requestProto); if (responseProto == null) return null; // Occurs on cancel return ResponseConverter.getResults(requestProto, rowMutationsIndexMap, responseProto, getRpcControllerCellScanner());
MultiServerCallable(final ClusterConnection connection, final TableName tableName, final ServerName location, final MultiAction multi, RpcController rpcController, int rpcTimeout, RetryingTimeTracker tracker, int priority) { super(connection, tableName, null, rpcController, rpcTimeout, tracker, priority); this.multiAction = multi; // RegionServerCallable has HRegionLocation field, but this is a multi-region request. // Using region info from parent HRegionLocation would be a mistake for this class; so // we will store the server here, and throw if someone tries to obtain location/regioninfo. this.location = new HRegionLocation(null, location); this.cellBlock = isCellBlock(); }
/** * @return True if we should send data in cellblocks. This is an expensive call. Cache the * result if you can rather than call each time. */ private boolean isCellBlock() { // This is not exact -- the configuration could have changed on us after connection was set up // but it will do for now. ClusterConnection conn = getConnection(); return conn.hasCellBlockSupport(); }
controller.setPriority(getTableName()); controller.setCallTimeout(callTimeout); ClientProtos.MultiResponse responseProto; ClientProtos.MultiRequest requestProto = multiRequestBuilder.build(); try { responseProto = getStub().multi(controller, requestProto); } catch (ServiceException e) { throw ProtobufUtil.getRemoteException(e);
@Override public void waitUntilDone() throws InterruptedIOException { try { waitUntilDone(Long.MAX_VALUE); } catch (InterruptedException iex) { throw new InterruptedIOException(iex.getMessage()); } finally { if (callsInProgress != null) { for (MultiServerCallable<Row> clb : callsInProgress) { clb.cancel(); } } } }
public void reset(ServerName location, MultiAction multiAction) { this.location = new HRegionLocation(null, location); this.multiAction = multiAction; this.cellBlock = isCellBlock(); }
/** * @return True if we should send data in cellblocks. This is an expensive call. Cache the * result if you can rather than call each time. */ private boolean isCellBlock() { // This is not exact -- the configuration could have changed on us after connection was set up // but it will do for now. ClusterConnection conn = getConnection(); return conn.hasCellBlockSupport(); }
setRpcControllerCellScanner(CellUtil.createCellScanner(cells)); ClientProtos.MultiResponse responseProto = getStub().multi(getRpcController(), requestProto); if (responseProto == null) return null; // Occurs on cancel return ResponseConverter.getResults(requestProto, rowMutationsIndexMap, responseProto, getRpcControllerCellScanner());
@Override public void prepare(boolean reload) throws IOException { // Use the location we were given in the constructor rather than go look it up. setStub(getConnection().getClient(this.location.getServerName())); }
public void reset(ServerName location, MultiAction multiAction) { this.location = new HRegionLocation(null, location); this.multiAction = multiAction; this.cellBlock = isCellBlock(); }
/** * @return True if we should send data in cellblocks. This is an expensive call. Cache the * result if you can rather than call each time. */ private boolean isCellBlock() { // This is not exact -- the configuration could have changed on us after connection was set up // but it will do for now. ClusterConnection conn = getConnection(); return conn.hasCellBlockSupport(); }
/** * Create a callable. Isolated to be easily overridden in the tests. */ private MultiServerCallable createCallable(final ServerName server, TableName tableName, final MultiAction multi) { return new MultiServerCallable(asyncProcess.connection, tableName, server, multi, asyncProcess.rpcFactory.newController(), rpcTimeout, tracker, multi.getPriority()); }
setRpcControllerCellScanner(CellUtil.createCellScanner(cells)); ClientProtos.MultiResponse responseProto = getStub().multi(getRpcController(), requestProto); if (responseProto == null) return null; // Occurs on cancel return ResponseConverter.getResults(requestProto, rowMutationsIndexMap, responseProto, getRpcControllerCellScanner());
@Override public void prepare(boolean reload) throws IOException { // Use the location we were given in the constructor rather than go look it up. setStub(getConnection().getClient(this.location.getServerName())); }
MultiServerCallable(final ClusterConnection connection, final TableName tableName, final ServerName location, final MultiAction multi, RpcController rpcController, int rpcTimeout, RetryingTimeTracker tracker, int priority) { super(connection, tableName, null, rpcController, rpcTimeout, tracker, priority); this.multiAction = multi; // RegionServerCallable has HRegionLocation field, but this is a multi-region request. // Using region info from parent HRegionLocation would be a mistake for this class; so // we will store the server here, and throw if someone tries to obtain location/regioninfo. this.location = new HRegionLocation(null, location); this.cellBlock = isCellBlock(); }
/** * @return True if we should send data in cellblocks. This is an expensive call. Cache the * result if you can rather than call each time. */ private boolean isCellBlock() { // This is not exact -- the configuration could have changed on us after connection was set up // but it will do for now. HConnection connection = getConnection(); if (!(connection instanceof ClusterConnection)) return true; // Default is to do cellblocks. return ((ClusterConnection) connection).hasCellBlockSupport(); }
/** * Create a callable. Isolated to be easily overridden in the tests. */ @VisibleForTesting protected MultiServerCallable<Row> createCallable(final ServerName server, TableName tableName, final MultiAction<Row> multi) { return new MultiServerCallable<Row>(connection, tableName, server, this.rpcFactory, multi); }
@Override public void prepare(boolean reload) throws IOException { // Use the location we were given in the constructor rather than go look it up. setStub(getConnection().getClient(this.location.getServerName())); }