Skip to content

Commit

Permalink
Consolidate import of Random
Browse files Browse the repository at this point in the history
  • Loading branch information
tedyu committed May 8, 2015
1 parent f6014c0 commit 56d7c92
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.util

import java.io.NotSerializableException
import java.util.Random

import org.scalatest.FunSuite

Expand Down Expand Up @@ -266,19 +267,15 @@ private object TestUserClosuresActuallyCleaned {
rdd.mapPartitionsWithIndex { (_, it) => return; it }.count()
}
def testFlatMapWith(rdd: RDD[Int]): Unit = {
import java.util.Random
rdd.flatMapWith ((index: Int) => new Random(index + 42)){ (_, it) => return; Seq() }.count()
}
def testMapWith(rdd: RDD[Int]): Unit = {
import java.util.Random
rdd.mapWith ((index: Int) => new Random(index + 42)){ (_, it) => return; 0 }.count()
}
def testFilterWith(rdd: RDD[Int]): Unit = {
import java.util.Random
rdd.filterWith ((index: Int) => new Random(index + 42)){ (_, it) => return; true }.count()
}
def testForEachWith(rdd: RDD[Int]): Unit = {
import java.util.Random
rdd.foreachWith ((index: Int) => new Random(index + 42)){ (_, it) => return }
}
def testMapPartitionsWithContext(rdd: RDD[Int]): Unit = {
Expand Down

0 comments on commit 56d7c92

Please sign in to comment.