[ https://issues.apache.org/jira/browse/KAFKA-5534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16069090#comment-16069090 ]
ASF GitHub Bot commented on KAFKA-5534: --------------------------------------- GitHub user vahidhashemian opened a pull request: https://github.com/apache/kafka/pull/3460 KAFKA-5534: `offsetForTimes` result should include partitions with no offset For topics that support timestamp search, if no offset is found for a partition, the partition should still be included in the result with a `null` offset value. This `KafkaConsumer` method currently excludes such partitions from the result. You can merge this pull request into a Git repository by running: $ git pull https://github.com/vahidhashemian/kafka KAFKA-5534 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3460.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3460 ---- commit 504b42c7acf6278de8ab19b4b78fea95e898a084 Author: Vahid Hashemian <vahidhashem...@us.ibm.com> Date: 2017-06-29T22:12:45Z KAFKA-5534: `offsetForTimes` result should include partitions with no offsets For topics that support timestamp search, if no offset is found for a partition, the partition should still be included in the result with a `null` offset value. ---- > KafkaConsumer offsetsForTimes should include partitions in result even if no > offset could be found > -------------------------------------------------------------------------------------------------- > > Key: KAFKA-5534 > URL: https://issues.apache.org/jira/browse/KAFKA-5534 > Project: Kafka > Issue Type: Bug > Components: consumer > Reporter: Jason Gustafson > Assignee: Vahid Hashemian > Fix For: 0.11.0.1 > > > From the javadoc for {{offsetsForTimes}}: > {code} > * @return a mapping from partition to the timestamp and offset of the > first message with timestamp greater > * than or equal to the target timestamp. {@code null} will be > returned for the partition if there is no > * such message. > {code} > If the topic does not support timestamp search (i.e. magic 1 and above), we > include the partition in the map with a null value, as described above. If > the topic supports timestamp search but no offset could be found, we just > leave the partition out of the map. We should make this behavior consistent > and include the partition with a null value in the result. -- This message was sent by Atlassian JIRA (v6.4.14#64029)