com.google.cloud.bigtable.grpc.async
Class CallController<RequestT,ResponseT>
- java.lang.Object
-
- io.grpc.stub.CallStreamObserver<V>
-
- io.grpc.stub.ClientCallStreamObserver<RequestT>
-
- com.google.cloud.bigtable.grpc.async.CallController<RequestT,ResponseT>
-
- All Implemented Interfaces:
- io.grpc.stub.StreamObserver<RequestT>
public class CallController<RequestT,ResponseT> extends io.grpc.stub.ClientCallStreamObserver<RequestT>
Wraps aClientCall
, and implementsClientCallStreamObserver
to allow access to the call's underlying functionality.This class is intended to be used by the user to control flow and the life of the call.
-
-
Constructor Summary
Constructors Constructor and Description CallController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
cancel(String s, Throwable throwable)
void
disableAutoInboundFlowControl()
Disable automatic calls toClientCall.request(int)
, and the user will explicitly request more results usingrequest(int)
.boolean
isAutoFlowControlEnabled()
boolean
isReady()
void
onCompleted()
void
onError(Throwable t)
void
onNext(RequestT value)
void
request(int count)
void
setMessageCompression(boolean enable)
void
setOnReadyHandler(Runnable onReadyHandler)
-
-
-
Method Detail
-
onNext
public void onNext(RequestT value)
-
onError
public void onError(Throwable t)
-
onCompleted
public void onCompleted()
-
isReady
public boolean isReady()
- Specified by:
isReady
in classio.grpc.stub.CallStreamObserver<RequestT>
-
setOnReadyHandler
public void setOnReadyHandler(Runnable onReadyHandler)
- Specified by:
setOnReadyHandler
in classio.grpc.stub.CallStreamObserver<RequestT>
-
disableAutoInboundFlowControl
public void disableAutoInboundFlowControl()
Disable automatic calls toClientCall.request(int)
, and the user will explicitly request more results usingrequest(int)
. Currently, this is only used for reading rows.- Specified by:
disableAutoInboundFlowControl
in classio.grpc.stub.CallStreamObserver<RequestT>
- See Also:
ResponseQueueReader.beforeStart(ClientCallStreamObserver)
,ResponseQueueReader.getNextMergedRow()
-
request
public void request(int count)
- Specified by:
request
in classio.grpc.stub.CallStreamObserver<RequestT>
-
setMessageCompression
public void setMessageCompression(boolean enable)
- Specified by:
setMessageCompression
in classio.grpc.stub.CallStreamObserver<RequestT>
-
cancel
public void cancel(@Nullable String s, @Nullable Throwable throwable)
- Specified by:
cancel
in classio.grpc.stub.ClientCallStreamObserver<RequestT>
-
isAutoFlowControlEnabled
public boolean isAutoFlowControlEnabled()
-
-