Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
void seek(TopicPartition partition, long offset, StringOffsetEpoch offsetEpoch);
 
OffsetAndMetadata positionWithOffsetEpoch(TopicPartition partition);

2) Add field offsetEpoch to the class org.apache.kafka.clients.consumer.OffsetAndMetadata and create new class OffsetEpoch

Code Block
public class OffsetAndMetadata {
 
  // This field encodes leader_epoch and partition_epoch. User should not need to interpret this value.
  private final OffsetEpoch offsetEpoch;
  .... // Other existing variables and methods
 
}
 
// This class will encode leader_epoch and topic_epoch. It can be evolved to encode more information in the future.
public class OffsetEpoch {

  static OffsetEpoch decode(byte[]);

  public byte[] encode();

  public String toString();
 
  private int topicEpoch();
 
  private int leaderEpoch();
 
  private OffsetEpoch(int topicEpoch, int leaderEpoch);

}

...