@InterfaceAudience.Private public class HBaseRpcControllerImpl extends Object implements HBaseRpcController
RpcControllerFactory
on client-side.RpcControllerFactory
HBaseRpcController.CancellationCallback
Modifier and Type | Field and Description |
---|---|
private Integer |
callTimeout
The time, in ms before the call should expire.
|
private List<org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object>> |
cancellationCbs |
private boolean |
cancelled |
private CellScanner |
cellScanner
They are optionally set on construction, cleared after we make the call, and then optionally
set on response with the result.
|
private boolean |
done |
private IOException |
exception |
private int |
priority
Priority to set on this request.
|
private RegionInfo |
regionInfo
Rpc target Region's RegionInfo we are going against.
|
Constructor and Description |
---|
HBaseRpcControllerImpl() |
HBaseRpcControllerImpl(CellScanner cellScanner)
Used server-side.
|
HBaseRpcControllerImpl(RegionInfo regionInfo,
CellScanner cellScanner) |
HBaseRpcControllerImpl(RegionInfo regionInfo,
List<CellScannable> cellIterables) |
Modifier and Type | Method and Description |
---|---|
CellScanner |
cellScanner()
Returns One-shot cell scanner (you cannot back it up and restart)
|
String |
errorText() |
boolean |
failed() |
int |
getCallTimeout() |
IOException |
getFailed()
Return the failed exception, null if not failed.
|
int |
getPriority()
Returns The priority of this request
|
RegionInfo |
getRegionInfo()
Returns Target Region's RegionInfo or null if not available or pertinent.
|
boolean |
hasCallTimeout() |
boolean |
hasRegionInfo()
Returns True if this Controller is carrying the RPC target Region's RegionInfo.
|
boolean |
isCanceled() |
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 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.
|
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 by
HBaseRpcController.setDone(CellScanner) . |
void |
setDone(CellScanner cellScanner)
IMPORTANT: always call this method if the call finished without any exception to tell
the
HBaseRpcController that we are done. |
void |
setFailed(IOException e)
Set failed with an exception to pass on.
|
void |
setFailed(String reason) |
void |
setPriority(int priority)
Set the priority for this operation.
|
void |
setPriority(TableName tn)
Set the priority for this operation.
|
void |
startCancel() |
String |
toString() |
private Integer callTimeout
private boolean done
private boolean cancelled
private final List<org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object>> cancellationCbs
private IOException exception
private RegionInfo regionInfo
hasRegionInfo()
private int priority
private CellScanner cellScanner
public HBaseRpcControllerImpl()
public HBaseRpcControllerImpl(CellScanner cellScanner)
RpcControllerFactory
HBaseRpcControllerImpl(RegionInfo regionInfo, CellScanner cellScanner)
HBaseRpcControllerImpl(RegionInfo regionInfo, List<CellScannable> cellIterables)
public boolean hasRegionInfo()
HBaseRpcController
hasRegionInfo
in interface HBaseRpcController
public RegionInfo getRegionInfo()
HBaseRpcController
getRegionInfo
in interface HBaseRpcController
public CellScanner cellScanner()
cellScanner
in interface CellScannable
public void setCellScanner(CellScanner cellScanner)
HBaseRpcController
HBaseRpcController.setDone(CellScanner)
.setCellScanner
in interface HBaseRpcController
public void setPriority(int priority)
HBaseRpcController
setPriority
in interface HBaseRpcController
priority
- Priority for this request; should fall roughly in the range
HConstants.NORMAL_QOS
to HConstants.HIGH_QOS
public void setPriority(TableName tn)
HBaseRpcController
setPriority
in interface HBaseRpcController
tn
- Set priority based off the table we are going against.public int getPriority()
HBaseRpcController
getPriority
in interface HBaseRpcController
public void reset()
reset
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public int getCallTimeout()
getCallTimeout
in interface HBaseRpcController
public void setCallTimeout(int callTimeout)
setCallTimeout
in interface HBaseRpcController
public boolean hasCallTimeout()
hasCallTimeout
in interface HBaseRpcController
public String errorText()
errorText
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public boolean failed()
failed
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public boolean isCanceled()
isCanceled
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback)
HBaseRpcController
HBaseRpcController
.notifyOnCancel
in interface HBaseRpcController
notifyOnCancel
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public void setFailed(String reason)
setFailed
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public void setFailed(IOException e)
HBaseRpcController
setFailed
in interface HBaseRpcController
e
- exception to set withpublic IOException getFailed()
HBaseRpcController
getFailed
in interface HBaseRpcController
public void setDone(CellScanner cellScanner)
HBaseRpcController
HBaseRpcController
that we are done.setDone
in interface HBaseRpcController
public void startCancel()
startCancel
in interface org.apache.hbase.thirdparty.com.google.protobuf.RpcController
public void notifyOnCancel(org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<Object> callback, HBaseRpcController.CancellationCallback action) throws IOException
HBaseRpcController
notifyOnCancel
in interface HBaseRpcController
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.