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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns A CellScanner over the containedCell
sboolean
failed()
int
Return the failed exception, null if not failed.int
Returns The priority of this requestGet the map of request attributesReturns Region's table name or null if not available or pertinent.boolean
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
(ExtendedCellScanner cellScanner) Only used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(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
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.ipc.HBaseRpcController
getRegionInfo, hasRegionInfo
-
Field Details
-
delegate
-
-
Constructor Details
-
DelegatingHBaseRpcController
-
-
Method Details
-
reset
- Specified by:
reset
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
failed
- Specified by:
failed
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
errorText
- Specified by:
errorText
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
startCancel
- Specified by:
startCancel
in interfaceorg.apache.hbase.thirdparty.com.google.protobuf.RpcController
-
setFailed
- Specified by:
setFailed
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
-
cellScanner
Description copied from interface:CellScannable
Returns A CellScanner over the containedCell
s- Specified by:
cellScanner
in interfaceCellScannable
- Specified by:
cellScanner
in interfaceExtendedCellScannable
-
setCellScanner
Description copied from interface:HBaseRpcController
Only used to send cells to rpc server, the returned cells should be set byHBaseRpcController.setDone(ExtendedCellScanner)
.- 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
-
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
-
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
-
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
-
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
-