Package com.google.cloud.grpc
Class GcpClientCall<ReqT,RespT>
java.lang.Object
io.grpc.ClientCall<ReqT,RespT>
com.google.cloud.grpc.GcpClientCall<ReqT,RespT>
public class GcpClientCall<ReqT,RespT>
extends io.grpc.ClientCall<ReqT,RespT>
A wrapper of ClientCall that can fetch the affinitykey from the request/response message.
It stores the information such as method, calloptions, the ChannelRef which created it, etc to facilitate creating new calls. It gets the affinitykey from the request/response message, and defines the callback functions to manage the number of active streams and bind/unbind the affinity key with the channel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA simple wrapper of ClientCall.Nested classes/interfaces inherited from class io.grpc.ClientCall
io.grpc.ClientCall.Listener<T extends Object> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGcpClientCall(GcpManagedChannel delegateChannel, io.grpc.MethodDescriptor<ReqT, RespT> methodDescriptor, io.grpc.CallOptions callOptions, AffinityConfig affinity) -
Method Summary
Modifier and TypeMethodDescriptionvoidio.grpc.AttributesMay only be called after Listener#onHeaders or Listener#onClose.voidbooleanisReady()Calls that send exactly one message should not check this method.voidrequest(int numMessages) voidsendMessage(ReqT message) Delay executing operations until call.sendMessage() is called, switch the channel, start the call, do previous operations, and finally do sendMessage().voidsetMessageCompression(boolean enabled) voidtoString()
-
Constructor Details
-
GcpClientCall
protected GcpClientCall(GcpManagedChannel delegateChannel, io.grpc.MethodDescriptor<ReqT, RespT> methodDescriptor, io.grpc.CallOptions callOptions, AffinityConfig affinity)
-
-
Method Details
-
start
-
request
public void request(int numMessages) -
setMessageCompression
public void setMessageCompression(boolean enabled) -
cancel
-
halfClose
public void halfClose() -
sendMessage
Delay executing operations until call.sendMessage() is called, switch the channel, start the call, do previous operations, and finally do sendMessage(). -
isReady
public boolean isReady()Calls that send exactly one message should not check this method. -
getAttributes
public io.grpc.Attributes getAttributes()May only be called after Listener#onHeaders or Listener#onClose. -
toString
-