Class OffsetAndTimestamp


  • public final class OffsetAndTimestamp
    extends java.lang.Object
    A container class for offset and timestamp.
    • Constructor Summary

      Constructors 
      Constructor Description
      OffsetAndTimestamp​(long offset, long timestamp)  
      OffsetAndTimestamp​(long offset, long timestamp, java.util.Optional<java.lang.Integer> leaderEpoch)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.util.Optional<java.lang.Integer> leaderEpoch()
      Get the leader epoch corresponding to the offset that was found (if one exists).
      long offset()  
      long timestamp()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • OffsetAndTimestamp

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

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

      • timestamp

        public long timestamp()
      • offset

        public long offset()
      • leaderEpoch

        public java.util.Optional<java.lang.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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object