@Override public void setPriority(int priority) { delegate.setPriority(priority); }
void setPriority(final TableName tableName) { if (this.rpcController != null) { this.rpcController.setPriority(tableName); } }
void setPriority(final int priority) { if (this.rpcController != null) { this.rpcController.setPriority(priority); } }
@Override public void setPriority(TableName tn) { delegate.setPriority(tn); }
/** * Override that changes Exception from {@link Exception} to {@link IOException}. It also does * setup of an rpcController and calls through to the unimplemented * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation. */ @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 T call(int callTimeout) throws IOException { this.controller = rpcControllerFactory.newController(); this.controller.setPriority(this.tableName); this.controller.setCallTimeout(callTimeout); try { return call(this.controller); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
/** * Override that changes call Exception from {@link Exception} to {@link IOException}. * Also does set up of the rpcController. */ @Override public T call(int callTimeout) throws IOException { try { // Iff non-null and an instance of a SHADED rpcController, do config! Unshaded -- i.e. // com.google.protobuf.RpcController or null -- will just skip over this config. if (getRpcController() != null) { RpcController shadedRpcController = (RpcController)getRpcController(); // Do a reset to clear previous states, such as CellScanner. shadedRpcController.reset(); if (shadedRpcController instanceof HBaseRpcController) { HBaseRpcController hrc = (HBaseRpcController)getRpcController(); // If it is an instance of HBaseRpcController, we can set priority on the controller based // off the tableName. Set call timeout too. hrc.setPriority(tableName); hrc.setPriority(priority); hrc.setCallTimeout(callTimeout); } } return rpcCall(); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); final AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); // TODO: There is no timeout on this controller. Set one! HBaseRpcController controller = rpcControllerFactory.newController(); controller.setPriority(HConstants.HIGH_QOS); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(controller, request); } 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()); } }
void setPriority(final TableName tableName) { if (this.rpcController != null) { this.rpcController.setPriority(tableName); } }
void setPriority(final int priority) { if (this.rpcController != null) { this.rpcController.setPriority(priority); } }
@Override public void setPriority(int priority) { delegate.setPriority(priority); }
@Override public void setPriority(TableName tn) { delegate.setPriority(tn); }
/** * Override that changes Exception from {@link Exception} to {@link IOException}. It also does * setup of an rpcController and calls through to the unimplemented * call(PayloadCarryingRpcController) method; implement this method to add your rpc invocation. */ @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 T call(int callTimeout) throws IOException { this.controller = rpcControllerFactory.newController(); this.controller.setPriority(this.tableName); this.controller.setCallTimeout(callTimeout); try { return call(this.controller); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
/** * Override that changes call Exception from {@link Exception} to {@link IOException}. * Also does set up of the rpcController. */ @Override public T call(int callTimeout) throws IOException { try { // Iff non-null and an instance of a SHADED rpcController, do config! Unshaded -- i.e. // com.google.protobuf.RpcController or null -- will just skip over this config. if (getRpcController() != null) { RpcController shadedRpcController = (RpcController)getRpcController(); // Do a reset to clear previous states, such as CellScanner. shadedRpcController.reset(); if (shadedRpcController instanceof HBaseRpcController) { HBaseRpcController hrc = (HBaseRpcController)getRpcController(); // If it is an instance of HBaseRpcController, we can set priority on the controller based // off the tableName. Set call timeout too. hrc.setPriority(tableName); hrc.setPriority(priority); hrc.setCallTimeout(callTimeout); } } return rpcCall(); } catch (Exception e) { throw ProtobufUtil.handleRemoteException(e); } }
@Override public synchronized void stopRegionServer(final String hostnamePort) throws IOException { String hostname = Addressing.parseHostname(hostnamePort); int port = Addressing.parsePort(hostnamePort); final AdminService.BlockingInterface admin = this.connection.getAdmin(ServerName.valueOf(hostname, port, 0)); // TODO: There is no timeout on this controller. Set one! HBaseRpcController controller = rpcControllerFactory.newController(); controller.setPriority(HConstants.HIGH_QOS); StopServerRequest request = RequestConverter.buildStopServerRequest( "Called by admin client " + this.connection.toString()); try { admin.stopServer(controller, request); } 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()); } }
void setPriority(final int priority) { if (this.rpcController != null) { this.rpcController.setPriority(priority); } }
void setPriority(final TableName tableName) { if (this.rpcController != null) { this.rpcController.setPriority(tableName); } }
@Override public void setPriority(int priority) { delegate.setPriority(priority); }
@Override public void setPriority(TableName tn) { delegate.setPriority(tn); }