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

 ##########
 File path: 
samza-core/src/main/scala/org/apache/samza/system/SystemConsumers.scala
 ##########
 @@ -208,7 +223,11 @@ class SystemConsumers (
       if (startpoint != null) {
         consumer.register(systemStreamPartition, startpoint)
       } else {
-        consumer.register(systemStreamPartition, offset)
+        val existingOffset = sspToRegisteredOffsets.get(systemStreamPartition)
+        val systemAdmin = 
systemAdmins.getSystemAdmin(systemStreamPartition.getSystem)
+        if (existingOffset == null || 
systemAdmin.offsetComparator(existingOffset, offset) > 0) {
+          sspToRegisteredOffsets.put(systemStreamPartition, offset)
 
 Review comment:
   Adding to @cameronlee314's comment. What's the motivation for only accepting 
the older offset if `register` is called multiple times? When would this 
happen? Is it the broadcast stream scenario?

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