Skip to content
Snippets Groups Projects
Commit 4619ee07 authored by Stephen Haberman's avatar Stephen Haberman
Browse files

Move JavaRDDLike.coalesce into the right places.

parent fb759987
No related branches found
No related tags found
No related merge requests found
......@@ -52,6 +52,11 @@ class JavaDoubleRDD(val srdd: RDD[scala.Double]) extends JavaRDDLike[Double, Jav
def filter(f: JFunction[Double, java.lang.Boolean]): JavaDoubleRDD =
fromRDD(srdd.filter(x => f(x).booleanValue()))
/**
* Return a new RDD that is reduced into `numSplits` partitions.
*/
def coalesce(numSplits: Int): JavaDoubleRDD = fromRDD(srdd.coalesce(numSplits))
/**
* Return a sampled subset of this RDD.
*/
......
......@@ -62,6 +62,11 @@ class JavaPairRDD[K, V](val rdd: RDD[(K, V)])(implicit val kManifest: ClassManif
def filter(f: Function[(K, V), java.lang.Boolean]): JavaPairRDD[K, V] =
new JavaPairRDD[K, V](rdd.filter(x => f(x).booleanValue()))
/**
* Return a new RDD that is reduced into `numSplits` partitions.
*/
def coalesce(numSplits: Int): JavaPairRDD[K, V] = new JavaPairRDD[K, V](rdd.coalesce(numSplits))
/**
* Return a sampled subset of this RDD.
*/
......
......@@ -38,6 +38,11 @@ JavaRDDLike[T, JavaRDD[T]] {
def filter(f: JFunction[T, java.lang.Boolean]): JavaRDD[T] =
wrapRDD(rdd.filter((x => f(x).booleanValue())))
/**
* Return a new RDD that is reduced into `numSplits` partitions.
*/
def coalesce(numSplits: Int): JavaRDD[T] = rdd.coalesce(numSplits)
/**
* Return a sampled subset of this RDD.
*/
......
......@@ -130,11 +130,6 @@ trait JavaRDDLike[T, This <: JavaRDDLike[T, This]] extends PairFlatMapWorkaround
JavaPairRDD.fromRDD(rdd.cartesian(other.rdd)(other.classManifest))(classManifest,
other.classManifest)
/**
* Return a new RDD that is reduced into `numSplits` partitions.
*/
def coalesce(numSplits: Int): JavaRDD[T] = rdd.coalesce(numSplits)
/**
* Return an RDD of grouped elements. Each group consists of a key and a sequence of elements
* mapping to that key.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment