Package org.apache.hadoop.hbase.ipc
Class HBaseRpcControllerImpl
java.lang.Object
org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl
- All Implemented Interfaces:
CellScannable,ExtendedCellScannable,HBaseRpcController,org.apache.hbase.thirdparty.com.google.protobuf.RpcController
Get instances via
RpcControllerFactory on client-side.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.ipc.HBaseRpcController
HBaseRpcController.CancellationCallback -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IntegerThe time, in ms before the call should expire.private booleanprivate ExtendedCellScannerThey are optionally set on construction, cleared after we make the call, and then optionally set on response with the result.private booleanprivate IOExceptionprivate intPriority to set on this request.private RegionInfoRpc target Region's RegionInfo we are going against.private TableName -
Constructor Summary
ConstructorsConstructorDescriptionHBaseRpcControllerImpl(RegionInfo regionInfo, List<ExtendedCellScannable> cellIterables) HBaseRpcControllerImpl(RegionInfo regionInfo, ExtendedCellScanner cellScanner) HBaseRpcControllerImpl(ExtendedCellScanner cellScanner) Used server-side. -
Method Summary
Modifier and TypeMethodDescriptionReturns One-shot cell scanner (you cannot back it up and restart)booleanfailed()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) Set the priority for this operation.voidsetPriority(TableName tn) Set the priority for this operation.voidsetRequestAttributes(Map<String, byte[]> requestAttributes) Set the map of request attributesvoidsetTableName(TableName tableName) Sets Region's table name.void
-
Field Details
-
callTimeout
The time, in ms before the call should expire. -
done
-
cancelled
-
cancellationCbs
private final List<org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object>> cancellationCbs -
exception
-
tableName
-
regionInfo
Rpc target Region's RegionInfo we are going against. May be null.- See Also:
-
priority
Priority to set on this request. Set it here in controller so available composing the request. This is the ordained way of setting priorities going forward. We will be undoing the old annotation-based mechanism. -
cellScanner
They are optionally set on construction, cleared after we make the call, and then optionally set on response with the result. We use this lowest common denominator access to Cells because sometimes the scanner is backed by a List of Cells and other times, it is backed by an encoded block that implements CellScanner. -
requestAttributes
-
-
Constructor Details
-
HBaseRpcControllerImpl
public HBaseRpcControllerImpl() -
HBaseRpcControllerImpl
Used server-side. Clients should go viaRpcControllerFactory -
HBaseRpcControllerImpl
HBaseRpcControllerImpl(RegionInfo regionInfo, ExtendedCellScanner cellScanner) -
HBaseRpcControllerImpl
HBaseRpcControllerImpl(RegionInfo regionInfo, List<ExtendedCellScannable> cellIterables)
-
-
Method Details
-
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
-
cellScanner
Returns One-shot cell scanner (you cannot back it up and restart)- 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
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
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.
-
getPriority
Description copied from interface:HBaseRpcControllerReturns The priority of this request- Specified by:
getPriorityin interfaceHBaseRpcController
-
reset
- Specified by:
resetin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
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
-
errorText
- Specified by:
errorTextin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
failed
- Specified by:
failedin 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
-
setFailed
- Specified by:
setFailedin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
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
-
startCancel
- Specified by:
startCancelin interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
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
-