Interface HBaseRpcController

All Superinterfaces:
CellScannable, ExtendedCellScannable, org.apache.hbase.thirdparty.com.google.protobuf.RpcController
All Known Implementing Classes:
DelegatingHBaseRpcController, HBaseRpcControllerImpl

@LimitedPrivate({"Coprocesssor","Phoenix","Replication"}) @Evolving public interface HBaseRpcController extends org.apache.hbase.thirdparty.com.google.protobuf.RpcController, ExtendedCellScannable
Optionally carries Cells across the proxy/service interface down into ipc. On its way out it optionally carries a set of result Cell data. We stick the Cells here when we want to avoid having to protobuf them (for performance reasons). This class is used ferrying data across the proxy/protobuf service chasm. Also does call timeout and on client-side, carries the target RegionInfo we're making the call against if relevant (useful adding info to exceptions and logs). Used by client and server ipc'ing.
  • Method Details

    • setCellScanner

      Only used to send cells to rpc server, the returned cells should be set by setDone(ExtendedCellScanner).
    • setPriority

      void setPriority(int priority)
      Set the priority for this operation.
      Parameters:
      priority - Priority for this request; should fall roughly in the range HConstants.NORMAL_QOS to HConstants.HIGH_QOS
    • setPriority

      Set the priority for this operation.
      Parameters:
      tn - Set priority based off the table we are going against.
    • getPriority

      Returns The priority of this request
    • getCallTimeout

    • setCallTimeout

      void setCallTimeout(int callTimeout)
    • hasCallTimeout

      boolean hasCallTimeout()
    • getRequestAttributes

      Get the map of request attributes
    • setRequestAttributes

      void setRequestAttributes(Map<String,byte[]> requestAttributes)
      Set the map of request attributes
    • setFailed

      Set failed with an exception to pass on. For use in async rpc clients
      Parameters:
      e - exception to set with
    • getFailed

      Return the failed exception, null if not failed.
    • setDone

      void setDone(ExtendedCellScanner cellScanner)
      IMPORTANT: always call this method if the call finished without any exception to tell the HBaseRpcController that we are done.
    • notifyOnCancel

      void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback)
      A little different from the basic RpcController:
      1. You can register multiple callbacks to an HBaseRpcController.
      2. The callback will not be called if the rpc call is finished without any cancellation.
      3. You can call me at client side also.
      Specified by:
      notifyOnCancel in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
    • notifyOnCancel

      void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback, HBaseRpcController.CancellationCallback action) throws IOException
      If not cancelled, add the callback to cancellation callback list. And then execute the action with the cancellation state as a parameter. The implementation should guarantee that the cancellation state does not change during this call.
      Throws:
      IOException
    • hasRegionInfo

      default boolean hasRegionInfo()
      Returns True if this Controller is carrying the RPC target Region's RegionInfo.
    • getRegionInfo

      Returns Target Region's RegionInfo or null if not available or pertinent.
    • setTableName

      default void setTableName(TableName tableName)
      Sets Region's table name.
    • getTableName

      Returns Region's table name or null if not available or pertinent.