Class Offset.SimpleOffset

  • All Implemented Interfaces:
    Offset, java.io.Serializable
    Enclosing interface:
    Offset

    public static final class Offset.SimpleOffset
    extends java.lang.Object
    implements Offset
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleOffset​(Partition partition, long elementIndex, boolean last)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      long getElementIndex()
      Index of the element within the partition.
      Partition getPartition()
      Partition the offset belongs to.
      int hashCode()  
      boolean isLast()
      Is there any other element in the partition?
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • SimpleOffset

        public SimpleOffset​(Partition partition,
                            long elementIndex,
                            boolean last)
    • Method Detail

      • getPartition

        public Partition getPartition()
        Description copied from interface: Offset
        Partition the offset belongs to.
        Specified by:
        getPartition in interface Offset
        Returns:
        Partition.
      • getElementIndex

        public long getElementIndex()
        Description copied from interface: Offset
        Index of the element within the partition. Elements are indexed from zero. Value of `-1` means, no element has been consumed from the partition.
        Specified by:
        getElementIndex in interface Offset
        Returns:
        Index of the element or `-1` if no element has been consumed.
      • isLast

        public boolean isLast()
        Description copied from interface: Offset
        Is there any other element in the partition?
        Specified by:
        isLast in interface Offset
        Returns:
        True if there are no more elements in the partition.
      • 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
      • toString

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