You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "KKcorps (via GitHub)" <gi...@apache.org> on 2023/02/24 17:56:03 UTC

[GitHub] [pinot] KKcorps commented on a diff in pull request #10326: Provide results in CompletableFuture for java clients and expose metrics

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-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org