Class OffsetAndTimestamp


  • public final class OffsetAndTimestamp
    extends Object
    A container class for offset and timestamp.
    • Constructor Detail

      • OffsetAndTimestamp

        public OffsetAndTimestamp​(long offset,
                                  long timestamp)
      • OffsetAndTimestamp

        public OffsetAndTimestamp​(long offset,
                                  long timestamp,
                                  Optional<Integer> leaderEpoch)
    • Method Detail

      • timestamp

        public long timestamp()
      • offset

        public long offset()
      • leaderEpoch

        public Optional<Integer> leaderEpoch()
        Get the leader epoch corresponding to the offset that was found (if one exists). This can be provided to seek() to ensure that the log hasn't been truncated prior to fetching.
        Returns:
        The leader epoch or empty if it is not known
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object