diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/src/main/scala/spark/examples/BroadcastTest.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/examples/src/main/scala/spark/examples/BroadcastTest.scala b/examples/src/main/scala/spark/examples/BroadcastTest.scala index 2506de5ae5..f3a173b183 100644 --- a/examples/src/main/scala/spark/examples/BroadcastTest.scala +++ b/examples/src/main/scala/spark/examples/BroadcastTest.scala @@ -5,9 +5,10 @@ import spark.SparkContext object BroadcastTest { def main(args: Array[String]) { if (args.length == 0) { - System.err.println("Usage: BroadcastTest <host> [<slices>]") + System.err.println("Usage: BroadcastTest <host> [<slices>] [numElem]") System.exit(1) } + val spark = new SparkContext(args(0), "Broadcast Test") val slices = if (args.length > 1) args(1).toInt else 2 val num = if (args.length > 2) args(2).toInt else 1000000 @@ -16,14 +17,8 @@ object BroadcastTest { for (i <- 0 until arr1.length) arr1(i) = i -// var arr2 = new Array[Int](num * 2) -// for (i <- 0 until arr2.length) -// arr2(i) = i - val barr1 = spark.broadcast(arr1) -// val barr2 = spark.broadcast(arr2) spark.parallelize(1 to 10, slices).foreach { -// i => println(barr1.value.size + barr2.value.size) i => println(barr1.value.size) } } |