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.

  • Constructor Details

  • Method Details

    • start

      public void start(io.grpc.ClientCall.Listener<RespT> responseListener, io.grpc.Metadata headers)
      Specified by:
      start in class io.grpc.ClientCall<ReqT,RespT>
    • request

      public void request(int numMessages)
      Specified by:
      request in class io.grpc.ClientCall<ReqT,RespT>
    • setMessageCompression

      public void setMessageCompression(boolean enabled)
      Overrides:
      setMessageCompression in class io.grpc.ClientCall<ReqT,RespT>
    • cancel

      public void cancel(@Nullable String message, @Nullable Throwable cause)
      Specified by:
      cancel in class io.grpc.ClientCall<ReqT,RespT>
    • halfClose

      public void halfClose()
      Specified by:
      halfClose in class io.grpc.ClientCall<ReqT,RespT>
    • sendMessage

      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().
      Specified by:
      sendMessage in class io.grpc.ClientCall<ReqT,RespT>
    • isReady

      public boolean isReady()
      Calls that send exactly one message should not check this method.
      Overrides:
      isReady in class io.grpc.ClientCall<ReqT,RespT>
    • getAttributes

      public io.grpc.Attributes getAttributes()
      May only be called after Listener#onHeaders or Listener#onClose.
      Overrides:
      getAttributes in class io.grpc.ClientCall<ReqT,RespT>
    • toString

      public String toString()
      Overrides:
      toString in class Object