ZihanLi58 commented on code in PR #3949:
URL: https://github.com/apache/gobblin/pull/3949#discussion_r1602361310


##########
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java:
##########
@@ -89,11 +89,15 @@ public static List<KafkaPartition> getPartitions(State 
state) {
       if 
(!state.contains(KafkaUtils.getPartitionPropName(KafkaSource.PARTITION_ID, i))) 
{
         break;
       }
-      KafkaPartition partition = new 
KafkaPartition.Builder().withTopicName(topicName)
-          
.withId(state.getPropAsInt(KafkaUtils.getPartitionPropName(KafkaSource.PARTITION_ID,
 i)))
-          
.withLeaderId(state.getPropAsInt(KafkaUtils.getPartitionPropName(KafkaSource.LEADER_ID,
 i)))
-          
.withLeaderHostAndPort(state.getProp(KafkaUtils.getPartitionPropName(KafkaSource.LEADER_HOSTANDPORT,
 i)))
-          .build();
+      KafkaPartition.Builder builder = new 
KafkaPartition.Builder().withTopicName(topicName)
+          
.withId(state.getPropAsInt(KafkaUtils.getPartitionPropName(KafkaSource.PARTITION_ID,
 i)));
+      if 
(state.contains(KafkaUtils.getPartitionPropName(KafkaSource.LEADER_ID, i))) {

Review Comment:
   getPartitionPropName is a static method of KafkaUtils. 



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