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:
[email protected]


With regards,
Apache Git Services

Reply via email to