Package org.apache.hadoop.hbase.ipc
Class DelegatingHBaseRpcController
java.lang.Object
org.apache.hadoop.hbase.ipc.DelegatingHBaseRpcController
- All Implemented Interfaces:
CellScannable,ExtendedCellScannable,HBaseRpcController,org.apache.hbase.thirdparty.com.google.protobuf.RpcController
Simple delegating controller for use with the
RpcControllerFactory to help override
standard behavior of a HBaseRpcController. Used testing.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.ipc.HBaseRpcController
HBaseRpcController.CancellationCallback -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns A CellScanner over the containedCellsbooleanfailed()intReturn the failed exception, null if not failed.intReturns The priority of this requestReturns Target Region's RegionInfo or null if not available or pertinent.Get the map of request attributesReturns Region's table name or null if not available or pertinent.booleanbooleanReturns True if this Controller is carrying the RPC target Region's RegionInfo.booleanvoidnotifyOnCancel(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.voidnotifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback, HBaseRpcController.CancellationCallback action) If not cancelled, add the callback to cancellation callback list.voidreset()voidsetCallTimeout(int callTimeout) voidsetCellScanner(ExtendedCellScanner cellScanner) Only used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(ExtendedCellScanner).voidsetDone(ExtendedCellScanner cellScanner) IMPORTANT: always call this method if the call finished without any exception to tell theHBaseRpcControllerthat we are done.voidSet failed with an exception to pass on.voidvoidsetPriority(int priority) Deprecated.voidsetPriority(int priority, @Nullable TableName tableName) Set the priority for this rpc request.voidsetPriority(TableName tn) Deprecated.voidsetRequestAttributes(Map<String, byte[]> requestAttributes) Set the map of request attributesvoidsetTableName(TableName tableName) Sets Region's table name.void
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingHBaseRpcController
-
-
Method Details
-
reset
- Specified by:
resetin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
failed
- Specified by:
failedin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
errorText
- Specified by:
errorTextin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
startCancel
- Specified by:
startCancelin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
setFailed
- Specified by:
setFailedin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
isCanceled
- Specified by:
isCanceledin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
notifyOnCancel
public void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback) Description copied from interface:HBaseRpcControllerA 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:
notifyOnCancelin interfaceHBaseRpcController- Specified by:
notifyOnCancelin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
- You can register multiple callbacks to an
-
cellScanner
Description copied from interface:CellScannableReturns A CellScanner over the containedCells- Specified by:
cellScannerin interfaceCellScannable- Specified by:
cellScannerin interfaceExtendedCellScannable
-
setCellScanner
Description copied from interface:HBaseRpcControllerOnly used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(ExtendedCellScanner).- Specified by:
setCellScannerin interfaceHBaseRpcController
-
setPriority
Deprecated.Description copied from interface:HBaseRpcControllerSet the priority for this operation.- Specified by:
setPriorityin interfaceHBaseRpcController- Parameters:
priority- Priority for this request; should fall roughly in the rangeHConstants.NORMAL_QOStoHConstants.HIGH_QOS
-
setPriority
Deprecated.Description copied from interface:HBaseRpcControllerSet the priority for this operation.- Specified by:
setPriorityin interfaceHBaseRpcController- Parameters:
tn- Set priority based off the table we are going against.
-
setPriority
Description copied from interface:HBaseRpcControllerSet the priority for this rpc request.For keep compatibility, here we declare the default method where we call
HBaseRpcController.setPriority(int)and thenHBaseRpcController.setPriority(TableName).The default implementation in HBase follow the below rules:
- If user set a priority explicitly, then just use it.
- For system table, use
HConstants.SYSTEMTABLE_QOS. - For other tables, use
HConstants.NORMAL_QOS.
- Specified by:
setPriorityin interfaceHBaseRpcController- Parameters:
priority- the priority set by user, can beHConstants.PRIORITY_UNSET.tableName- the table we operate on, can be null.
-
hasRegionInfo
Description copied from interface:HBaseRpcControllerReturns True if this Controller is carrying the RPC target Region's RegionInfo.- Specified by:
hasRegionInfoin interfaceHBaseRpcController
-
getRegionInfo
Description copied from interface:HBaseRpcControllerReturns Target Region's RegionInfo or null if not available or pertinent.- Specified by:
getRegionInfoin interfaceHBaseRpcController
-
getPriority
Description copied from interface:HBaseRpcControllerReturns The priority of this request- Specified by:
getPriorityin interfaceHBaseRpcController
-
getCallTimeout
- Specified by:
getCallTimeoutin interfaceHBaseRpcController
-
setCallTimeout
- Specified by:
setCallTimeoutin interfaceHBaseRpcController
-
hasCallTimeout
- Specified by:
hasCallTimeoutin interfaceHBaseRpcController
-
getRequestAttributes
Description copied from interface:HBaseRpcControllerGet the map of request attributes- Specified by:
getRequestAttributesin interfaceHBaseRpcController
-
setRequestAttributes
Description copied from interface:HBaseRpcControllerSet the map of request attributes- Specified by:
setRequestAttributesin interfaceHBaseRpcController
-
setFailed
Description copied from interface:HBaseRpcControllerSet failed with an exception to pass on. For use in async rpc clients- Specified by:
setFailedin interfaceHBaseRpcController- Parameters:
e- exception to set with
-
getFailed
Description copied from interface:HBaseRpcControllerReturn the failed exception, null if not failed.- Specified by:
getFailedin interfaceHBaseRpcController
-
setDone
Description copied from interface:HBaseRpcControllerIMPORTANT: always call this method if the call finished without any exception to tell theHBaseRpcControllerthat we are done.- Specified by:
setDonein interfaceHBaseRpcController
-
notifyOnCancel
public void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback, HBaseRpcController.CancellationCallback action) throws IOException Description copied from interface:HBaseRpcControllerIf 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.- Specified by:
notifyOnCancelin interfaceHBaseRpcController- Throws:
IOException
-
setTableName
Description copied from interface:HBaseRpcControllerSets Region's table name.- Specified by:
setTableNamein interfaceHBaseRpcController
-
getTableName
Description copied from interface:HBaseRpcControllerReturns Region's table name or null if not available or pertinent.- Specified by:
getTableNamein interfaceHBaseRpcController
-