Class ApacheHttpAsyncStorageNodeClient

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

    public class ApacheHttpAsyncStorageNodeClient
    extends java.lang.Object
    implements StorageNodeClient
    • Constructor Detail

      • ApacheHttpAsyncStorageNodeClient

        public ApacheHttpAsyncStorageNodeClient​(VeniceRouterConfig config,
                                                java.util.Optional<SSLFactory> sslFactory,
                                                io.tehuti.metrics.MetricsRepository metricsRepository,
                                                LiveInstanceMonitor monitor)
    • Method Detail

      • getHttpClientForHost

        public org.apache.http.impl.nio.client.CloseableHttpAsyncClient getHttpClientForHost​(java.lang.String host)
      • close

        public void close()
        Description copied from interface: StorageNodeClient
        Close the client and release all resources held by the client
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface StorageNodeClient
      • query

        public void query​(Instance host,
                          VenicePath path,
                          java.util.function.Consumer<PortableHttpResponse> completedCallBack,
                          java.util.function.Consumer<java.lang.Throwable> failedCallBack,
                          java.util.function.BooleanSupplier cancelledCallBack)
                   throws RouterException
        Description copied from interface: StorageNodeClient
        Send a request to storage node
        Specified by:
        query in interface StorageNodeClient
        Parameters:
        host - The target host to which the request will be sent
        path - contains information like URI, request content, HTTP method, etc.
        completedCallBack - Callback function for a complete response
        failedCallBack - if any exception thrown in the channel
        cancelledCallBack - for requests that are cancelled by the channel
        Throws:
        RouterException