Interface StorageNodeClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
- All Known Implementing Classes:
ApacheHttpAsyncStorageNodeClient
,HttpClient5StorageNodeClient
public interface StorageNodeClient extends java.io.Closeable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
close()
Close the client and release all resources held by the clientdefault boolean
isInstanceReadyToServe(java.lang.String instanceId)
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)
Send a request to storage nodedefault void
sendRequest(VeniceMetaDataRequest request, java.util.concurrent.CompletableFuture<PortableHttpResponse> responseConsumer)
void
start()
Start the client and prepare the required resources.
-
-
-
Method Detail
-
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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
query
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
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
default boolean isInstanceReadyToServe(java.lang.String instanceId)
-
sendRequest
default void sendRequest(VeniceMetaDataRequest request, java.util.concurrent.CompletableFuture<PortableHttpResponse> responseConsumer)
-
-