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