Interface HBaseRpcController

All Superinterfaces:
CellScannable, 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, CellScannable
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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    Return the failed exception, null if not failed.
    int
    Returns The priority of this request
    default RegionInfo
    Returns Target Region's RegionInfo or null if not available or pertinent.
    Map<String,byte[]>
    Get the map of request attributes
    default TableName
    Returns Region's table name or null if not available or pertinent.
    boolean
     
    default boolean
    Returns True if this Controller is carrying the RPC target Region's RegionInfo.
    void
    notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback)
    A little different from the basic RpcController: You can register multiple callbacks to an HBaseRpcController. The callback will not be called if the rpc call is finished without any cancellation. You can call me at client side also.
    void
    notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback, HBaseRpcController.CancellationCallback action)
    If not cancelled, add the callback to cancellation callback list.
    void
    setCallTimeout(int callTimeout)
     
    void
    Only used to send cells to rpc server, the returned cells should be set by setDone(CellScanner).
    void
    setDone(CellScanner cellScanner)
    IMPORTANT: always call this method if the call finished without any exception to tell the HBaseRpcController that we are done.
    void
    Set failed with an exception to pass on.
    void
    setPriority(int priority)
    Set the priority for this operation.
    void
    Set the priority for this operation.
    void
    setRequestAttributes(Map<String,byte[]> requestAttributes)
    Set the map of request attributes
    default void
    Sets Region's table name.

    Methods inherited from interface org.apache.hadoop.hbase.CellScannable

    cellScanner

    Methods inherited from interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController

    errorText, failed, isCanceled, reset, setFailed, startCancel
  • Method Details

    • setCellScanner

      void setCellScanner(CellScanner cellScanner)
      Only used to send cells to rpc server, the returned cells should be set by setDone(CellScanner).
    • 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(CellScanner 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.