KKcorps commented on code in PR #10326: URL: https://github.com/apache/pinot/pull/10326#discussion_r1117403802
########## pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/PinotClientTransport.java: ########## @@ -18,28 +18,38 @@ */ package org.apache.pinot.client; -import java.util.concurrent.Future; +import java.util.concurrent.CompletableFuture; /** * Interface for plugging different client transports. */ -public interface PinotClientTransport { +public interface PinotClientTransport<METRICS> { BrokerResponse executeQuery(String brokerAddress, String query) throws PinotClientException; - Future<BrokerResponse> executeQueryAsync(String brokerAddress, String query) + CompletableFuture<BrokerResponse> executeQueryAsync(String brokerAddress, String query) throws PinotClientException; @Deprecated BrokerResponse executeQuery(String brokerAddress, Request request) throws PinotClientException; @Deprecated - Future<BrokerResponse> executeQueryAsync(String brokerAddress, Request request) + CompletableFuture<BrokerResponse> executeQueryAsync(String brokerAddress, Request request) throws PinotClientException; void close() throws PinotClientException; + + /** + * Access to the client metrics implementation if any. + * This may be useful for observability into the client implementation. + * + * @return underlying client metrics if any + */ + default METRICS getClientMetrics() { + return null; Review Comment: Better to throw `UnsupportedOperationException` here rather than returning null. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org