You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2019/05/06 17:19:09 UTC

[GitHub] [storm] srdo commented on a change in pull request #2911: STORM-2720 : Add TIMESTAMP option for FirstPollOffset for Kafka Trident spout

srdo commented on a change in pull request #2911: STORM-2720 : Add TIMESTAMP option for FirstPollOffset for Kafka Trident spout
URL: https://github.com/apache/storm/pull/2911#discussion_r281277063
 
 

 ##########
 File path: external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/trident/KafkaTridentSpoutEmitter.java
 ##########
 @@ -279,6 +293,25 @@ private long seek(TopicPartition tp, KafkaTridentSpoutBatchMetadata lastBatchMet
         return fetchOffset;
     }
 
+    /**
+     * Seek the consumer to offset corresponding to startTimeStamp.
+     */
+    private void seekOffsetByStartTimeStamp(TopicPartition tp) {
+        long startTimeStampOffset;
+        try {
+            startTimeStampOffset =
+                    consumer.offsetsForTimes(Collections.singletonMap(tp, startTimeStamp)).get(tp).offset();
 
 Review comment:
   Nit: I would like this broken up into multiple statements so we can tell where it breaks if we get an NPE.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services