@InterfaceAudience.Private public class TimeLimitedRpcController extends Object implements com.google.protobuf.RpcController
| Modifier and Type | Field and Description |
|---|---|
protected Integer |
callTimeout
The time, in ms before the call should expire.
|
protected AtomicReference<com.google.protobuf.RpcCallback<Object>> |
cancellationCb |
protected boolean |
cancelled |
private IOException |
exception |
protected AtomicReference<com.google.protobuf.RpcCallback<IOException>> |
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(com.google.protobuf.RpcCallback<Object> cancellationCb) |
void |
notifyOnFail(com.google.protobuf.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<com.google.protobuf.RpcCallback<Object>> cancellationCb
protected final AtomicReference<com.google.protobuf.RpcCallback<IOException>> failureCb
private IOException exception
public int getCallTimeout()
public void setCallTimeout(int callTimeout)
public boolean hasCallTimeout()
public 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<Object> cancellationCb)
notifyOnCancel in interface com.google.protobuf.RpcControllerpublic void notifyOnFail(com.google.protobuf.RpcCallback<IOException> failureCb)
failureCb - the callback to call on errorpublic void reset()
reset in interface com.google.protobuf.RpcControllerpublic void setFailed(String reason)
setFailed in interface com.google.protobuf.RpcControllerpublic void setFailed(IOException e)
e - exception to set withpublic void startCancel()
startCancel in interface com.google.protobuf.RpcControllerCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.