Interface StorageNodeClient
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ApacheHttpAsyncStorageNodeClient
,HttpClient5StorageNodeClient
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the client and release all resources held by the clientdefault boolean
isInstanceReadyToServe
(String instanceId) void
query
(Instance host, VenicePath path, Consumer<PortableHttpResponse> completedCallBack, Consumer<Throwable> failedCallBack, BooleanSupplier cancelledCallBack) Send a request to storage nodedefault void
sendRequest
(VeniceMetaDataRequest request, CompletableFuture<PortableHttpResponse> responseConsumer) void
start()
Start the client and prepare the required resources.
-
Method Details
-
start
void start()Start the client and prepare the required resources. -
close
void close()Close the client and release all resources held by the client- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
query
void query(Instance host, VenicePath path, Consumer<PortableHttpResponse> completedCallBack, Consumer<Throwable> failedCallBack, BooleanSupplier cancelledCallBack) throws RouterException Send a request to storage node- 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
-
isInstanceReadyToServe
-
sendRequest
default void sendRequest(VeniceMetaDataRequest request, CompletableFuture<PortableHttpResponse> responseConsumer)
-