diff options
author | Jakob Odersky <jakob@odersky.com> | 2016-02-04 22:22:41 -0800 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-02-04 22:22:41 -0800 |
commit | 352102ed0b7be8c335553d7e0389fd7ce83f5fbf (patch) | |
tree | cac6d85957cf56120f011642df4c0e526dfc7578 /core | |
parent | e3c75c6398b1241500343ff237e9bcf78b5396f9 (diff) | |
download | spark-352102ed0b7be8c335553d7e0389fd7ce83f5fbf.tar.gz spark-352102ed0b7be8c335553d7e0389fd7ce83f5fbf.tar.bz2 spark-352102ed0b7be8c335553d7e0389fd7ce83f5fbf.zip |
[SPARK-13208][CORE] Replace use of Pairs with Tuple2s
Another trivial deprecation fix for Scala 2.11
Author: Jakob Odersky <jakob@odersky.com>
Closes #11089 from jodersky/SPARK-13208.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/org/apache/spark/api/java/JavaDoubleRDD.scala | 2 | ||||
-rw-r--r-- | core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/api/java/JavaDoubleRDD.scala b/core/src/main/scala/org/apache/spark/api/java/JavaDoubleRDD.scala index 37ae007f88..13e18a56c8 100644 --- a/core/src/main/scala/org/apache/spark/api/java/JavaDoubleRDD.scala +++ b/core/src/main/scala/org/apache/spark/api/java/JavaDoubleRDD.scala @@ -230,7 +230,7 @@ class JavaDoubleRDD(val srdd: RDD[scala.Double]) * If the RDD contains infinity, NaN throws an exception * If the elements in RDD do not vary (max == min) always returns a single bucket. */ - def histogram(bucketCount: Int): Pair[Array[scala.Double], Array[Long]] = { + def histogram(bucketCount: Int): (Array[scala.Double], Array[Long]) = { val result = srdd.histogram(bucketCount) (result._1, result._2) } diff --git a/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala b/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala index c07f346bba..bd61d04d42 100644 --- a/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala +++ b/core/src/main/scala/org/apache/spark/rdd/DoubleRDDFunctions.scala @@ -103,7 +103,7 @@ class DoubleRDDFunctions(self: RDD[Double]) extends Logging with Serializable { * If the RDD contains infinity, NaN throws an exception * If the elements in RDD do not vary (max == min) always returns a single bucket. */ - def histogram(bucketCount: Int): Pair[Array[Double], Array[Long]] = self.withScope { + def histogram(bucketCount: Int): (Array[Double], Array[Long]) = self.withScope { // Scala's built-in range has issues. See #SI-8782 def customRange(min: Double, max: Double, steps: Int): IndexedSeq[Double] = { val span = max - min @@ -112,7 +112,7 @@ class DoubleRDDFunctions(self: RDD[Double]) extends Logging with Serializable { // Compute the minimum and the maximum val (max: Double, min: Double) = self.mapPartitions { items => Iterator(items.foldRight(Double.NegativeInfinity, - Double.PositiveInfinity)((e: Double, x: Pair[Double, Double]) => + Double.PositiveInfinity)((e: Double, x: (Double, Double)) => (x._1.max(e), x._2.min(e)))) }.reduce { (maxmin1, maxmin2) => (maxmin1._1.max(maxmin2._1), maxmin1._2.min(maxmin2._2)) |