Class GcpClientCall<ReqT,RespT> (1.11.0)

public class GcpClientCall<ReqT,RespT> extends 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.

Inheritance

java.lang.Object > io.grpc.ClientCall > GcpClientCall<ReqT,RespT>

Type Parameters

Name Description
ReqT
RespT

Constructors

GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor<ReqT,RespT> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)

protected GcpClientCall(GcpManagedChannel delegateChannel, MethodDescriptor<ReqT,RespT> methodDescriptor, CallOptions callOptions, AffinityConfig affinity)
Parameters
Name Description
delegateChannel GcpManagedChannel
methodDescriptor io.grpc.MethodDescriptor<ReqT,RespT>
callOptions io.grpc.CallOptions
affinity AffinityConfig

Methods

cancel(String message, Throwable cause)

public void cancel(String message, Throwable cause)
Parameters
Name Description
message String
cause Throwable
Overrides
io.grpc.ClientCall.cancel(java.lang.String,java.lang.Throwable)

getAttributes()

public Attributes getAttributes()

May only be called after Listener#onHeaders or Listener#onClose.

Returns
Type Description
io.grpc.Attributes
Overrides
io.grpc.ClientCall.getAttributes()

halfClose()

public void halfClose()
Overrides
io.grpc.ClientCall.halfClose()

isReady()

public boolean isReady()

Calls that send exactly one message should not check this method.

Returns
Type Description
boolean
Overrides
io.grpc.ClientCall.isReady()

request(int numMessages)

public void request(int numMessages)
Parameter
Name Description
numMessages int
Overrides
io.grpc.ClientCall.request(int)

sendMessage(ReqT message)

public void sendMessage(ReqT message)

Delay executing operations until call.sendMessage() is called, switch the channel, start the call, do previous operations, and finally do sendMessage().

Parameter
Name Description
message ReqT
Overrides
io.grpc.ClientCall.sendMessage(ReqT)

setMessageCompression(boolean enabled)

public void setMessageCompression(boolean enabled)
Parameter
Name Description
enabled boolean
Overrides
io.grpc.ClientCall.setMessageCompression(boolean)

start(ClientCall.Listener<RespT> responseListener, Metadata headers)

public void start(ClientCall.Listener<RespT> responseListener, Metadata headers)
Parameters
Name Description
responseListener io.grpc.ClientCall.Listener<RespT>
headers io.grpc.Metadata
Overrides
io.grpc.ClientCall.start(io.grpc.ClientCall.Listener<RespT>,io.grpc.Metadata)

toString()

public String toString()
Returns
Type Description
String
Overrides