@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 |
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
public int getCallTimeout()
public void setCallTimeout(int callTimeout)
public boolean hasCallTimeout()
public String errorText()
errorText
in interface com.google.protobuf.RpcController
public boolean failed()
failed
in interface com.google.protobuf.RpcController
public boolean isCanceled()
isCanceled
in interface com.google.protobuf.RpcController
public void notifyOnCancel(com.google.protobuf.RpcCallback<Object> cancellationCb)
notifyOnCancel
in interface com.google.protobuf.RpcController
public void notifyOnFail(com.google.protobuf.RpcCallback<IOException> failureCb)
failureCb
- the callback to call on errorpublic void reset()
reset
in interface com.google.protobuf.RpcController
public void setFailed(String reason)
setFailed
in interface com.google.protobuf.RpcController
public void setFailed(IOException e)
e
- exception to set withpublic void startCancel()
startCancel
in interface com.google.protobuf.RpcController
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.