aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala
diff options
context:
space:
mode:
Diffstat (limited to 'sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala30
1 files changed, 0 insertions, 30 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala
index 729c8462fe..ebc6ee8184 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/CompositeOffset.scala
@@ -24,36 +24,6 @@ package org.apache.spark.sql.execution.streaming
*/
case class CompositeOffset(offsets: Seq[Option[Offset]]) extends Offset {
/**
- * Returns a negative integer, zero, or a positive integer as this object is less than, equal to,
- * or greater than the specified object.
- */
- override def compareTo(other: Offset): Int = other match {
- case otherComposite: CompositeOffset if otherComposite.offsets.size == offsets.size =>
- val comparisons = offsets.zip(otherComposite.offsets).map {
- case (Some(a), Some(b)) => a compareTo b
- case (None, None) => 0
- case (None, _) => -1
- case (_, None) => 1
- }
- val nonZeroSigns = comparisons.map(sign).filter(_ != 0).toSet
- nonZeroSigns.size match {
- case 0 => 0 // if both empty or only 0s
- case 1 => nonZeroSigns.head // if there are only (0s and 1s) or (0s and -1s)
- case _ => // there are both 1s and -1s
- throw new IllegalArgumentException(
- s"Invalid comparison between non-linear histories: $this <=> $other")
- }
- case _ =>
- throw new IllegalArgumentException(s"Cannot compare $this <=> $other")
- }
-
- private def sign(num: Int): Int = num match {
- case i if i < 0 => -1
- case i if i == 0 => 0
- case i if i > 0 => 1
- }
-
- /**
* Unpacks an offset into [[StreamProgress]] by associating each offset with the order list of
* sources.
*