xiangfu0 commented on code in PR #14678:
URL: https://github.com/apache/pinot/pull/14678#discussion_r1889481320


##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-2.0/src/main/java/org/apache/pinot/plugin/stream/kafka20/KafkaStreamMetadataProvider.java:
##########
@@ -169,14 +172,19 @@ public Map<String, PartitionLagState> 
getCurrentPartitionLagState(
 
   @Override
   public List<TopicMetadata> getTopics() {
-    Map<String, List<PartitionInfo>> namePartitionsMap = 
_consumer.listTopics();
-    if (namePartitionsMap == null) {
-      return Collections.emptyList();
+    try (AdminClient adminClient = createAdminClient()) {

Review Comment:
   Shall we cache the AdminClient? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to