PrachiKhobragade commented on code in PR #9249:
URL: https://github.com/apache/pinot/pull/9249#discussion_r950550273


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java:
##########
@@ -131,4 +144,22 @@ public void throttle(int numMsgs) {
       return _rate;
     }
   }
+
+  @VisibleForTesting
+  @FunctionalInterface
+  interface PartitionCountFetcher {
+    Integer fetch(StreamConfig streamConfig);
+  }
+
+  @VisibleForTesting
+  static final PartitionCountFetcher DEFAULT_PARTITION_COUNT_FETCHER = 
streamConfig -> {
+    String clientId = streamConfig.getTopicName() + 
"-consumption.rate.manager";
+    StreamConsumerFactory factory = 
StreamConsumerFactoryProvider.create(streamConfig);
+    try (StreamMetadataProvider streamMetadataProvider = 
factory.createStreamMetadataProvider(clientId)) {
+      return 
streamMetadataProvider.fetchPartitionCount(/*maxWaitTimeMs*/10_000);

Review Comment:
   we need to honor this in the implementation



-- 
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

Reply via email to