final case class LocationInPartition(offset: Long, sequenceNr: Long) extends PartiallyOrdered[LocationInPartition] with Product with Serializable
An event in a given partition can be identified by a sequence number, which is guaranteed to be incremented by 1 from one event to the next in a partition, and an offset, which in the current implementation is (per https://stackoverflow.com/a/66294545/5641244 from a Microsoft engineer) "the number of bytes from the beginning of the partition to the first byte of the event".
This does imply that for instances of this class which came from the same partition, their offsets and sequence numbers will compare the same (viz. (this.offset < that.offset) == (this.sequenceNr < that.sequenceNr)). However, for instances which came from different partitions, this relationship may not hold (consider one partition where most events are a few bytes while another partition where most events are larger than a hundred thousand bytes: an event with sequence number 5 in the former partition might have offset 96, while an event with sequence number 2 from the latter partition could have offset 205000).
The compareTo method does not fully obey the contract of java.lang.Comparable.compareTo.
- Alphabetic
- By Inheritance
- LocationInPartition
- Serializable
- Product
- Equals
- PartiallyOrdered
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type AsPartiallyOrdered[B] = (B) => PartiallyOrdered[B]
- Definition Classes
- PartiallyOrdered
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <[B >: LocationInPartition](that: B)(implicit arg0: AsPartiallyOrdered[B]): Boolean
- Definition Classes
- PartiallyOrdered
- def <=[B >: LocationInPartition](that: B)(implicit arg0: AsPartiallyOrdered[B]): Boolean
- Definition Classes
- PartiallyOrdered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >[B >: LocationInPartition](that: B)(implicit arg0: AsPartiallyOrdered[B]): Boolean
- Definition Classes
- PartiallyOrdered
- def >=[B >: LocationInPartition](that: B)(implicit arg0: AsPartiallyOrdered[B]): Boolean
- Definition Classes
- PartiallyOrdered
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compareTo(other: LocationInPartition): Int
Java API
Java API
Returns -1 if this location is considered less than the other, 1 if considered greater than the other, and 0 otherwise (either the same location, or not comparable (e.g. came from different partitions)).
Accordingly, this ordering is inconsistent with equals and does not generally obey the contract of
Comparable.compareTo - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val offset: Long
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val sequenceNr: Long
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tryCompareTo[B >: LocationInPartition](that: B)(implicit evidence: (B) => PartiallyOrdered[B]): Option[Int]
Scala API
Scala API
Returns Some(-1) if this location is considered less than the other, Some(1) if considered greater than the other, Some(0) if considered the same location, and None if not comparable (e.g. come from different partitions).
- Definition Classes
- LocationInPartition → PartiallyOrdered
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()