/** * Get the RpcController CellScanner. * If the RpcController is a HBaseRpcController, which it is in all cases except * when we are processing Coprocessor Endpoint, then this method returns a reference to the * CellScanner that the HBaseRpcController is carrying. Do it up here in this Callable * so we don't have to scatter ugly instanceof tests around the codebase. Will return null * if called in a Coproccessor Endpoint context. Should never happen. */ protected CellScanner getRpcControllerCellScanner() { return (getRpcController() != null && getRpcController() instanceof HBaseRpcController)? ((HBaseRpcController)getRpcController()).cellScanner(): null; }
protected void setRpcControllerCellScanner(CellScanner cellScanner) { if (getRpcController() != null && getRpcController() instanceof HBaseRpcController) { ((HBaseRpcController)this.rpcController).setCellScanner(cellScanner); } }
/** * 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); } }
/** * Get the RpcController CellScanner. * If the RpcController is a HBaseRpcController, which it is in all cases except * when we are processing Coprocessor Endpoint, then this method returns a reference to the * CellScanner that the HBaseRpcController is carrying. Do it up here in this Callable * so we don't have to scatter ugly instanceof tests around the codebase. Will return null * if called in a Coproccessor Endpoint context. Should never happen. */ protected CellScanner getRpcControllerCellScanner() { return (getRpcController() != null && getRpcController() instanceof HBaseRpcController)? ((HBaseRpcController)getRpcController()).cellScanner(): null; }
protected void setRpcControllerCellScanner(CellScanner cellScanner) { if (getRpcController() != null && getRpcController() instanceof HBaseRpcController) { ((HBaseRpcController)this.rpcController).setCellScanner(cellScanner); } }
/** * 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); } }
/** * Get the RpcController CellScanner. * If the RpcController is a HBaseRpcController, which it is in all cases except * when we are processing Coprocessor Endpoint, then this method returns a reference to the * CellScanner that the HBaseRpcController is carrying. Do it up here in this Callable * so we don't have to scatter ugly instanceof tests around the codebase. Will return null * if called in a Coproccessor Endpoint context. Should never happen. */ protected CellScanner getRpcControllerCellScanner() { return (getRpcController() != null && getRpcController() instanceof HBaseRpcController)? ((HBaseRpcController)getRpcController()).cellScanner(): null; }
protected void setRpcControllerCellScanner(CellScanner cellScanner) { if (getRpcController() != null && getRpcController() instanceof HBaseRpcController) { ((HBaseRpcController)this.rpcController).setCellScanner(cellScanner); } }
/** * 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); } }