@InterfaceAudience.Private public class TimeLimitedRpcController extends Object implements RpcController
| Modifier and Type | Field and Description |
|---|---|
protected Integer |
callTimeout
The time, in ms before the call should expire.
|
protected AtomicReference<RpcCallback<Object>> |
cancellationCb |
protected boolean |
cancelled |
protected AtomicReference<RpcCallback<IOException>> |
failureCb |
| Constructor and Description |
|---|
TimeLimitedRpcController() |
| Modifier and Type | Method and Description |
|---|---|
String |
errorText() |
boolean |
failed()
For use in async rpc clients
|
Integer |
getCallTimeout() |
boolean |
hasCallTimeout() |
boolean |
isCanceled() |
void |
notifyOnCancel(RpcCallback<Object> cancellationCb) |
void |
notifyOnFail(RpcCallback<IOException> failureCb)
Notify a callback on error.
|
void |
reset() |
void |
setCallTimeout(int callTimeout) |
void |
setFailed(IOException e)
Set failed with an exception to pass on.
|
void |
setFailed(String reason) |
void |
startCancel() |
protected volatile Integer callTimeout
protected volatile boolean cancelled
protected final AtomicReference<RpcCallback<Object>> cancellationCb
protected final AtomicReference<RpcCallback<IOException>> failureCb
public Integer getCallTimeout()
public void setCallTimeout(int callTimeout)
public boolean hasCallTimeout()
public String errorText()
errorText in interface RpcControllerpublic boolean failed()
failed in interface RpcControllerpublic boolean isCanceled()
isCanceled in interface RpcControllerpublic void notifyOnCancel(RpcCallback<Object> cancellationCb)
notifyOnCancel in interface RpcControllerpublic void notifyOnFail(RpcCallback<IOException> failureCb)
failureCb - the callback to call on errorpublic void reset()
reset in interface RpcControllerpublic void setFailed(String reason)
setFailed in interface RpcControllerpublic void setFailed(IOException e)
e - exception to set withpublic void startCancel()
startCancel in interface RpcControllerCopyright © 2015 The Apache Software Foundation. All Rights Reserved.