Naireen commented on code in PR #32402:
URL: https://github.com/apache/beam/pull/32402#discussion_r1767684034


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java:
##########
@@ -568,7 +577,22 @@ private void consumerPollLoop() {
       while (!closed.get()) {
         try {
           if (records.isEmpty()) {
+            // Each source has a single unique topic.
+            List<TopicPartition> topicPartitions = 
source.getSpec().getTopicPartitions();
+            Preconditions.checkStateNotNull(topicPartitions);
+            String topicName = "null"; // value will be overridden
+            for (TopicPartition topicPartition : topicPartitions) {
+              topicName = topicPartition.topic();
+              break;
+            }
+
+            java.time.Instant operationStartTime = java.time.Instant.now();

Review Comment:
   Just need elapsed, done.



##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java:
##########
@@ -568,7 +577,22 @@ private void consumerPollLoop() {
       while (!closed.get()) {
         try {
           if (records.isEmpty()) {
+            // Each source has a single unique topic.
+            List<TopicPartition> topicPartitions = 
source.getSpec().getTopicPartitions();
+            Preconditions.checkStateNotNull(topicPartitions);
+            String topicName = "null"; // value will be overridden
+            for (TopicPartition topicPartition : topicPartitions) {
+              topicName = topicPartition.topic();

Review Comment:
   Done.



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

Reply via email to