Package org.apache.hadoop.hbase.ipc
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.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Return the failed exception, null if not failed.int
Returns The priority of this requestdefault RegionInfo
Returns Target Region's RegionInfo or null if not available or pertinent.Get the map of request attributesdefault 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 anHBaseRpcController
. 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
setCellScanner
(ExtendedCellScanner cellScanner) Only used to send cells to rpc server, the returned cells should be set bysetDone(ExtendedCellScanner)
.void
setDone
(ExtendedCellScanner cellScanner) IMPORTANT: always call this method if the call finished without any exception to tell theHBaseRpcController
that we are done.void
Set failed with an exception to pass on.void
setPriority
(int priority) Set the priority for this operation.void
setPriority
(TableName tn) Set the priority for this operation.void
setRequestAttributes
(Map<String, byte[]> requestAttributes) Set the map of request attributesdefault void
setTableName
(TableName tableName) Sets Region's table name.Methods inherited from interface org.apache.hadoop.hbase.ExtendedCellScannable
cellScanner
Methods inherited from interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
errorText, failed, isCanceled, reset, setFailed, startCancel
-
Method Details
-
setCellScanner
Only used to send cells to rpc server, the returned cells should be set bysetDone(ExtendedCellScanner)
. -
setPriority
Set the priority for this operation.- Parameters:
priority
- Priority for this request; should fall roughly in the rangeHConstants.NORMAL_QOS
toHConstants.HIGH_QOS
-
setPriority
Set the priority for this operation.- Parameters:
tn
- Set priority based off the table we are going against.
-
getPriority
int getPriority()Returns The priority of this request -
getCallTimeout
int getCallTimeout() -
setCallTimeout
-
hasCallTimeout
boolean hasCallTimeout() -
getRequestAttributes
Map<String,byte[]> getRequestAttributes()Get the map of request attributes -
setRequestAttributes
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
IMPORTANT: always call this method if the call finished without any exception to tell theHBaseRpcController
that we are done. -
notifyOnCancel
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.
- Specified by:
notifyOnCancel
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
- You can register multiple callbacks to an
-
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
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
Sets Region's table name. -
getTableName
Returns Region's table name or null if not available or pertinent.
-