diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-22 14:55:46 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-02-22 14:55:46 -0800 |
commit | fcf7fa84486b743bc84730dfaa29927e25c1690d (patch) | |
tree | 16fd87c26cc84b3f00e350227462296be0548c06 | |
parent | 05bc02e80be78d83937bf57f726946e297d0dd08 (diff) | |
parent | f8c3a03d553c7c2818a9c13a7b4f70fe6a9d5afa (diff) | |
download | spark-fcf7fa84486b743bc84730dfaa29927e25c1690d.tar.gz spark-fcf7fa84486b743bc84730dfaa29927e25c1690d.tar.bz2 spark-fcf7fa84486b743bc84730dfaa29927e25c1690d.zip |
Merge pull request #489 from pwendell/SPARK-702
SPARK-702: Replace Function --> JFunction in JavaAPI Suite.
-rw-r--r-- | core/src/main/scala/spark/api/java/JavaPairRDD.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/api/java/JavaPairRDD.scala b/core/src/main/scala/spark/api/java/JavaPairRDD.scala index df3af3817d..c41207773e 100644 --- a/core/src/main/scala/spark/api/java/JavaPairRDD.scala +++ b/core/src/main/scala/spark/api/java/JavaPairRDD.scala @@ -59,7 +59,7 @@ class JavaPairRDD[K, V](val rdd: RDD[(K, V)])(implicit val kManifest: ClassManif /** * Return a new RDD containing only the elements that satisfy a predicate. */ - def filter(f: Function[(K, V), java.lang.Boolean]): JavaPairRDD[K, V] = + def filter(f: JFunction[(K, V), java.lang.Boolean]): JavaPairRDD[K, V] = new JavaPairRDD[K, V](rdd.filter(x => f(x).booleanValue())) /** @@ -102,7 +102,7 @@ class JavaPairRDD[K, V](val rdd: RDD[(K, V)])(implicit val kManifest: ClassManif * In addition, users can control the partitioning of the output RDD, and whether to perform * map-side aggregation (if a mapper can produce multiple items with the same key). */ - def combineByKey[C](createCombiner: Function[V, C], + def combineByKey[C](createCombiner: JFunction[V, C], mergeValue: JFunction2[C, V, C], mergeCombiners: JFunction2[C, C, C], partitioner: Partitioner): JavaPairRDD[K, C] = { @@ -309,7 +309,7 @@ class JavaPairRDD[K, V](val rdd: RDD[(K, V)])(implicit val kManifest: ClassManif * Pass each value in the key-value pair RDD through a map function without changing the keys; * this also retains the original RDD's partitioning. */ - def mapValues[U](f: Function[V, U]): JavaPairRDD[K, U] = { + def mapValues[U](f: JFunction[V, U]): JavaPairRDD[K, U] = { implicit val cm: ClassManifest[U] = implicitly[ClassManifest[AnyRef]].asInstanceOf[ClassManifest[U]] fromRDD(rdd.mapValues(f)) |