Class HttpClient5StorageNodeClient
java.lang.Object
com.linkedin.venice.router.httpclient.HttpClient5StorageNodeClient
- All Implemented Interfaces:
StorageNodeClient
,Closeable
,AutoCloseable
-
Constructor Summary
ConstructorDescriptionHttpClient5StorageNodeClient
(Optional<SSLFactory> sslFactory, VeniceRouterConfig routerConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the client and release all resources held by the clientvoid
query
(Instance host, VenicePath path, Consumer<PortableHttpResponse> completedCallBack, Consumer<Throwable> failedCallBack, BooleanSupplier cancelledCallBack) Send a request to storage nodevoid
sendRequest
(VeniceMetaDataRequest request, CompletableFuture<PortableHttpResponse> responseFuture) void
start()
Start the client and prepare the required resources.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.router.httpclient.StorageNodeClient
isInstanceReadyToServe
-
Constructor Details
-
HttpClient5StorageNodeClient
public HttpClient5StorageNodeClient(Optional<SSLFactory> sslFactory, VeniceRouterConfig routerConfig)
-
-
Method Details
-
start
public void start()Description copied from interface:StorageNodeClient
Start the client and prepare the required resources.- Specified by:
start
in interfaceStorageNodeClient
-
close
public void close()Description copied from interface:StorageNodeClient
Close the client and release all resources held by the client- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceStorageNodeClient
-
query
public void query(Instance host, VenicePath path, Consumer<PortableHttpResponse> completedCallBack, Consumer<Throwable> failedCallBack, BooleanSupplier cancelledCallBack) throws RouterException Description copied from interface:StorageNodeClient
Send a request to storage node- Specified by:
query
in interfaceStorageNodeClient
- Parameters:
host
- The target host to which the request will be sentpath
- contains information like URI, request content, HTTP method, etc.completedCallBack
- Callback function for a complete responsefailedCallBack
- if any exception thrown in the channelcancelledCallBack
- for requests that are cancelled by the channel- Throws:
RouterException
-
sendRequest
public void sendRequest(VeniceMetaDataRequest request, CompletableFuture<PortableHttpResponse> responseFuture) - Specified by:
sendRequest
in interfaceStorageNodeClient
-