@InterfaceAudience.Private public class TimeLimitedRpcController extends Object
Modifier and Type | Field and Description |
---|---|
protected Integer |
callTimeout
The time, in ms before the call should expire.
|
protected AtomicReference<<any>> |
cancellationCb |
protected boolean |
cancelled |
protected AtomicReference<<any>> |
failureCb |
Constructor and Description |
---|
TimeLimitedRpcController() |
Modifier and Type | Method and Description |
---|---|
String |
errorText() |
boolean |
failed()
For use in async rpc clients
|
int |
getCallTimeout() |
boolean |
hasCallTimeout() |
boolean |
isCanceled() |
void |
notifyOnCancel(<any> cancellationCb) |
void |
notifyOnFail(<any> 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<<any>> cancellationCb
protected final AtomicReference<<any>> failureCb
public int getCallTimeout()
public void setCallTimeout(int callTimeout)
public boolean hasCallTimeout()
public String errorText()
public boolean failed()
public boolean isCanceled()
public void notifyOnCancel(<any> cancellationCb)
public void notifyOnFail(<any> failureCb)
failureCb
- the callback to call on errorpublic void reset()
public void setFailed(String reason)
public void setFailed(IOException e)
e
- exception to set withpublic void startCancel()