Package org.apache.hadoop.hbase.ipc
Class HBaseRpcControllerImpl
java.lang.Object
org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl
- All Implemented Interfaces:
CellScannable
,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
Modifier and TypeFieldDescriptionprivate Integer
The time, in ms before the call should expire.private boolean
private CellScanner
They are optionally set on construction, cleared after we make the call, and then optionally set on response with the result.private boolean
private IOException
private int
Priority to set on this request.private RegionInfo
Rpc target Region's RegionInfo we are going against.private TableName
-
Constructor Summary
ConstructorDescriptionHBaseRpcControllerImpl
(CellScanner cellScanner) Used server-side.HBaseRpcControllerImpl
(RegionInfo regionInfo, List<CellScannable> cellIterables) HBaseRpcControllerImpl
(RegionInfo regionInfo, CellScanner cellScanner) -
Method Summary
Modifier and TypeMethodDescriptionReturns One-shot cell scanner (you cannot back it up and restart)boolean
failed()
int
Return the failed exception, null if not failed.int
Returns 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.boolean
boolean
Returns True if this Controller is carrying the RPC target Region's RegionInfo.boolean
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
reset()
void
setCallTimeout
(int callTimeout) void
setCellScanner
(CellScanner cellScanner) Only used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(CellScanner)
.void
setDone
(CellScanner 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
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 attributesvoid
setTableName
(TableName tableName) Sets Region's table name.void
toString()
-
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, CellScanner cellScanner) -
HBaseRpcControllerImpl
HBaseRpcControllerImpl(RegionInfo regionInfo, List<CellScannable> cellIterables)
-
-
Method Details
-
hasRegionInfo
Description copied from interface:HBaseRpcController
Returns True if this Controller is carrying the RPC target Region's RegionInfo.- Specified by:
hasRegionInfo
in interfaceHBaseRpcController
-
getRegionInfo
Description copied from interface:HBaseRpcController
Returns Target Region's RegionInfo or null if not available or pertinent.- Specified by:
getRegionInfo
in interfaceHBaseRpcController
-
cellScanner
Returns One-shot cell scanner (you cannot back it up and restart)- Specified by:
cellScanner
in interfaceCellScannable
-
setCellScanner
Description copied from interface:HBaseRpcController
Only used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(CellScanner)
.- Specified by:
setCellScanner
in interfaceHBaseRpcController
-
setPriority
Description copied from interface:HBaseRpcController
Set the priority for this operation.- Specified by:
setPriority
in interfaceHBaseRpcController
- Parameters:
priority
- Priority for this request; should fall roughly in the rangeHConstants.NORMAL_QOS
toHConstants.HIGH_QOS
-
setPriority
Description copied from interface:HBaseRpcController
Set the priority for this operation.- Specified by:
setPriority
in interfaceHBaseRpcController
- Parameters:
tn
- Set priority based off the table we are going against.
-
getPriority
Description copied from interface:HBaseRpcController
Returns The priority of this request- Specified by:
getPriority
in interfaceHBaseRpcController
-
reset
- Specified by:
reset
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
getCallTimeout
- Specified by:
getCallTimeout
in interfaceHBaseRpcController
-
setCallTimeout
- Specified by:
setCallTimeout
in interfaceHBaseRpcController
-
hasCallTimeout
- Specified by:
hasCallTimeout
in interfaceHBaseRpcController
-
getRequestAttributes
Description copied from interface:HBaseRpcController
Get the map of request attributes- Specified by:
getRequestAttributes
in interfaceHBaseRpcController
-
setRequestAttributes
Description copied from interface:HBaseRpcController
Set the map of request attributes- Specified by:
setRequestAttributes
in interfaceHBaseRpcController
-
errorText
- Specified by:
errorText
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
failed
- Specified by:
failed
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
isCanceled
- Specified by:
isCanceled
in 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:HBaseRpcController
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 interfaceHBaseRpcController
- Specified by:
notifyOnCancel
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
- You can register multiple callbacks to an
-
setFailed
- Specified by:
setFailed
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
setFailed
Description copied from interface:HBaseRpcController
Set failed with an exception to pass on. For use in async rpc clients- Specified by:
setFailed
in interfaceHBaseRpcController
- Parameters:
e
- exception to set with
-
getFailed
Description copied from interface:HBaseRpcController
Return the failed exception, null if not failed.- Specified by:
getFailed
in interfaceHBaseRpcController
-
setDone
Description copied from interface:HBaseRpcController
IMPORTANT: always call this method if the call finished without any exception to tell theHBaseRpcController
that we are done.- Specified by:
setDone
in interfaceHBaseRpcController
-
startCancel
- Specified by:
startCancel
in 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:HBaseRpcController
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.- Specified by:
notifyOnCancel
in interfaceHBaseRpcController
- Throws:
IOException
-
toString
-
setTableName
Description copied from interface:HBaseRpcController
Sets Region's table name.- Specified by:
setTableName
in interfaceHBaseRpcController
-
getTableName
Description copied from interface:HBaseRpcController
Returns Region's table name or null if not available or pertinent.- Specified by:
getTableName
in interfaceHBaseRpcController
-