@Override public void reset() { delegate.reset(); }
static void resetController(HBaseRpcController controller, long timeoutNs) { controller.reset(); if (timeoutNs >= 0) { controller.setCallTimeout( (int) Math.min(Integer.MAX_VALUE, TimeUnit.NANOSECONDS.toMillis(timeoutNs))); } }
/** * Override that changes the {@link java.util.concurrent.Callable#call()} Exception from {@link Exception} to * {@link IOException}. It also does setup of an rpcController and calls through to the rpcCall() * method which callers are expected to implement. If rpcController is an instance of * PayloadCarryingRpcController, we will set a timeout on it. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public V call(int callTimeout) throws IOException { try { if (this.rpcController != null) { this.rpcController.reset(); this.rpcController.setCallTimeout(callTimeout); } return rpcCall(); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
controller.reset(); try { RegionInfo rsRegion =
@Override // TODO: Very like the super class implemenation. Can we shrink this down? protected Result rpcCall() throws Exception { if (getRpcController().isCanceled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } byte[] reg = location.getRegionInfo().getRegionName(); ClientProtos.GetRequest request = RequestConverter.buildGetRequest(reg, get); HBaseRpcController hrc = (HBaseRpcController)getRpcController(); hrc.reset(); hrc.setCallTimeout(rpcTimeout); hrc.setPriority(tableName); ClientProtos.GetResponse response = getStub().get(hrc, request); if (response == null) { return null; } return ProtobufUtil.toResult(response.getResult(), hrc.cellScanner()); } }
@Override public void reset() { delegate.reset(); }
int timeout = 100; for (int i = 0; i < 10; i++) { pcrc.reset(); pcrc.setCallTimeout(timeout); long startTime = System.nanoTime();
static void resetController(HBaseRpcController controller, long timeoutNs) { controller.reset(); if (timeoutNs >= 0) { controller.setCallTimeout( (int) Math.min(Integer.MAX_VALUE, TimeUnit.NANOSECONDS.toMillis(timeoutNs))); } }
hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults()); hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults()); for (int i = COUNT / 2; i < COUNT; i++) { req = RequestConverter.buildScanRequest(scannerId, 1, false, nextCallSeq++, false, false, -1); hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults());
/** * Override that changes the {@link java.util.concurrent.Callable#call()} Exception from {@link Exception} to * {@link IOException}. It also does setup of an rpcController and calls through to the rpcCall() * method which callers are expected to implement. If rpcController is an instance of * PayloadCarryingRpcController, we will set a timeout on it. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public V call(int callTimeout) throws IOException { try { if (this.rpcController != null) { this.rpcController.reset(); this.rpcController.setCallTimeout(callTimeout); } return rpcCall(); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override // TODO: Very like the super class implemenation. Can we shrink this down? protected Result rpcCall() throws Exception { if (getRpcController().isCanceled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } byte[] reg = location.getRegionInfo().getRegionName(); ClientProtos.GetRequest request = RequestConverter.buildGetRequest(reg, get); HBaseRpcController hrc = (HBaseRpcController)getRpcController(); hrc.reset(); hrc.setCallTimeout(rpcTimeout); hrc.setPriority(tableName); ClientProtos.GetResponse response = getStub().get(hrc, request); if (response == null) { return null; } return ProtobufUtil.toResult(response.getResult(), hrc.cellScanner()); } }
@Override public void reset() { delegate.reset(); }
static void resetController(HBaseRpcController controller, long timeoutNs) { controller.reset(); if (timeoutNs >= 0) { controller.setCallTimeout( (int) Math.min(Integer.MAX_VALUE, TimeUnit.NANOSECONDS.toMillis(timeoutNs))); } }
/** * Override that changes the {@link java.util.concurrent.Callable#call()} Exception from {@link Exception} to * {@link IOException}. It also does setup of an rpcController and calls through to the rpcCall() * method which callers are expected to implement. If rpcController is an instance of * PayloadCarryingRpcController, we will set a timeout on it. */ @Override // Same trick as in RegionServerCallable so users don't have to copy/paste so much boilerplate // and so we contain references to protobuf. We can't set priority on the rpcController as // we do in RegionServerCallable because we don't always have a Table when we call. public V call(int callTimeout) throws IOException { try { if (this.rpcController != null) { this.rpcController.reset(); this.rpcController.setCallTimeout(callTimeout); } return rpcCall(); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override // TODO: Very like the super class implemenation. Can we shrink this down? protected Result rpcCall() throws Exception { if (getRpcController().isCanceled()) return null; if (Thread.interrupted()) { throw new InterruptedIOException(); } byte[] reg = location.getRegionInfo().getRegionName(); ClientProtos.GetRequest request = RequestConverter.buildGetRequest(reg, get); HBaseRpcController hrc = (HBaseRpcController)getRpcController(); hrc.reset(); hrc.setCallTimeout(rpcTimeout); hrc.setPriority(tableName); ClientProtos.GetResponse response = getStub().get(hrc, request); if (response == null) { return null; } return ProtobufUtil.toResult(response.getResult(), hrc.cellScanner()); } }
int timeout = 100; for (int i = 0; i < 10; i++) { pcrc.reset(); pcrc.setCallTimeout(timeout); long startTime = System.nanoTime();
hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults()); hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults()); for (int i = COUNT / 2; i < COUNT; i++) { req = RequestConverter.buildScanRequest(scannerId, 1, false, nextCallSeq++, false, false, -1); hrc.reset(); resp = STUB.scan(hrc, req); assertTrue(resp.getMoreResults());