cameronlee314 commented on a change in pull request #918: SAMZA-2094: Implement 
the StartpointVisitor for the KafkaSystemConsumer.
URL: https://github.com/apache/samza/pull/918#discussion_r257060720
 
 

 ##########
 File path: 
samza-kafka/src/main/java/org/apache/samza/system/kafka/KafkaSystemConsumer.java
 ##########
 @@ -163,26 +191,35 @@ void startConsumer() {
       LOG.error ("{}: Consumer is not subscribed to any SSPs", this);
     }
 
-    topicPartitionsToOffset.forEach((tp, startingOffsetString) -> {
-      long startingOffset = Long.valueOf(startingOffsetString);
+    // If both the startpoint and checkpointed offsets are present for a topic 
partition,
+    // then precedence is given to the startpoint.
+    topicPartitionToStartpointMap.forEach((topicPartition, startpoint) -> {
+      Partition partition = new Partition(topicPartition.partition());
+      SystemStreamPartition systemStreamPartition = new 
SystemStreamPartition(systemName, topicPartition.topic(), partition);
+      startpoint.apply(systemStreamPartition, 
kafkaStartpointRegistrationHandler);
+      // add the partition to the proxy
+      proxy.addTopicPartition(topicPartitionsToSSP.get(topicPartition), 
kafkaConsumer.position(topicPartition));
 
 Review comment:
   Can this be moved into the registration handler? Seems like this 
functionality would fall into the responsibility of that object.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to