Class D2TransportClient

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class D2TransportClient
    extends TransportClient
    D2Client based TransportClient implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      D2TransportClient​(java.lang.String d2ServiceName, com.linkedin.d2.balancer.D2Client d2Client)
      Construct by an existing D2Client (such as from the pegasus-d2-client-default-cmpt).
      D2TransportClient​(java.lang.String d2ServiceName, ClientConfig clientConfig)
      Construct by customized zookeeper and other configs.
    • Constructor Detail

      • D2TransportClient

        public D2TransportClient​(java.lang.String d2ServiceName,
                                 com.linkedin.d2.balancer.D2Client d2Client)
        Construct by an existing D2Client (such as from the pegasus-d2-client-default-cmpt).
        Parameters:
        d2ServiceName -
        d2Client -
      • D2TransportClient

        public D2TransportClient​(java.lang.String d2ServiceName,
                                 ClientConfig clientConfig)
        Construct by customized zookeeper and other configs.
        Parameters:
        d2ServiceName -
        clientConfig -
    • Method Detail

      • getServiceName

        public java.lang.String getServiceName()
      • setServiceName

        public void setServiceName​(java.lang.String serviceName)
      • get

        public java.util.concurrent.CompletableFuture<TransportClientResponse> get​(java.lang.String requestPath,
                                                                                   java.util.Map<java.lang.String,​java.lang.String> headers)
        Specified by:
        get in class TransportClient
      • post

        public java.util.concurrent.CompletableFuture<TransportClientResponse> post​(java.lang.String requestPath,
                                                                                    java.util.Map<java.lang.String,​java.lang.String> headers,
                                                                                    byte[] requestBody)
        Specified by:
        post in class TransportClient
      • close

        public void close()
      • getD2Client

        public com.linkedin.d2.balancer.D2Client getD2Client()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object