Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12541

Extend ListOffset to fetch offset with max timestamp (KIP-734)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0
    • admin

    Description

      In Kafka 2.7 the following method was added to AdminClient that provides this information:

      public ListOffsetsResult listOffsets(Map<TopicPartition,OffsetSpec> topicPartitionOffsets,
                                           ListOffsetsOptions options)

      https://kafka.apache.org/27/javadoc/org/apache/kafka/clients/admin/KafkaAdminClient.html#listOffsets-java.util.Map-org.apache.kafka.clients.admin.ListOffsetsOptions-

      where OffsetSpec can be:

      • OffsetSpec.EarliestSpec
      • OffsetSpec.LatestSpec
      • OffsetSpec.TimestampSpec

       
      This ticket introduces a new spec:

      OffsetSpec.MaxTimestampSpec // this returns the offset and timestamp for the record with the highest timestamp.

      This indicates to the AdminClient that we want to fetch the timestamp and offset for the record with the largest timestamp produced to a partition.

      Attachments

        Issue Links

          Activity

            People

              tom@confluent.io Tom Scott
              tom@confluent.io Tom Scott
              David Jacot David Jacot
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: