From 28fed4ce3be7fd564b5556f5c1782445466419bd Mon Sep 17 00:00:00 2001 From: Matei Zaharia Date: Tue, 5 Jun 2012 23:31:28 -0700 Subject: [PATCH] Add System.exit(0) at the end of all the example programs. --- examples/src/main/scala/spark/examples/BroadcastTest.scala | 2 ++ .../src/main/scala/spark/examples/ExceptionHandlingTest.scala | 2 ++ examples/src/main/scala/spark/examples/GroupByTest.scala | 2 ++ examples/src/main/scala/spark/examples/HdfsTest.scala | 1 + examples/src/main/scala/spark/examples/MultiBroadcastTest.scala | 2 ++ .../src/main/scala/spark/examples/SimpleSkewedGroupByTest.scala | 2 ++ examples/src/main/scala/spark/examples/SkewedGroupByTest.scala | 2 ++ examples/src/main/scala/spark/examples/SparkALS.scala | 2 ++ examples/src/main/scala/spark/examples/SparkHdfsLR.scala | 1 + examples/src/main/scala/spark/examples/SparkKMeans.scala | 1 + examples/src/main/scala/spark/examples/SparkLR.scala | 1 + examples/src/main/scala/spark/examples/SparkPi.scala | 1 + 12 files changed, 19 insertions(+) diff --git a/examples/src/main/scala/spark/examples/BroadcastTest.scala b/examples/src/main/scala/spark/examples/BroadcastTest.scala index f3a173b183..4a560131e3 100644 --- a/examples/src/main/scala/spark/examples/BroadcastTest.scala +++ b/examples/src/main/scala/spark/examples/BroadcastTest.scala @@ -21,5 +21,7 @@ object BroadcastTest { spark.parallelize(1 to 10, slices).foreach { i => println(barr1.value.size) } + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala b/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala index 46f658eab2..90941ddbf0 100644 --- a/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala +++ b/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala @@ -14,5 +14,7 @@ object ExceptionHandlingTest { if (Math.random > 0.75) throw new Exception("Testing exception handling") } + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/GroupByTest.scala b/examples/src/main/scala/spark/examples/GroupByTest.scala index 48c02a52c6..9d11692aeb 100644 --- a/examples/src/main/scala/spark/examples/GroupByTest.scala +++ b/examples/src/main/scala/spark/examples/GroupByTest.scala @@ -32,6 +32,8 @@ object GroupByTest { pairs1.count println(pairs1.groupByKey(numReducers).count) + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/HdfsTest.scala b/examples/src/main/scala/spark/examples/HdfsTest.scala index 072b4ce417..7a4530609d 100644 --- a/examples/src/main/scala/spark/examples/HdfsTest.scala +++ b/examples/src/main/scala/spark/examples/HdfsTest.scala @@ -14,5 +14,6 @@ object HdfsTest { val end = System.currentTimeMillis() println("Iteration " + iter + " took " + (end-start) + " ms") } + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/MultiBroadcastTest.scala b/examples/src/main/scala/spark/examples/MultiBroadcastTest.scala index c5c63ec4cb..240376da90 100644 --- a/examples/src/main/scala/spark/examples/MultiBroadcastTest.scala +++ b/examples/src/main/scala/spark/examples/MultiBroadcastTest.scala @@ -26,5 +26,7 @@ object MultiBroadcastTest { spark.parallelize(1 to 10, slices).foreach { i => println(barr1.value.size + barr2.value.size) } + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SimpleSkewedGroupByTest.scala b/examples/src/main/scala/spark/examples/SimpleSkewedGroupByTest.scala index c8edb7d8b4..c44b42c5b6 100644 --- a/examples/src/main/scala/spark/examples/SimpleSkewedGroupByTest.scala +++ b/examples/src/main/scala/spark/examples/SimpleSkewedGroupByTest.scala @@ -46,6 +46,8 @@ object SimpleSkewedGroupByTest { //println("RESULT: " + pairs1.groupByKey(numReducers) // .map{case (k,v) => (k, v.size)} // .collectAsMap) + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SkewedGroupByTest.scala b/examples/src/main/scala/spark/examples/SkewedGroupByTest.scala index e6dec44bed..9fad7ab2e5 100644 --- a/examples/src/main/scala/spark/examples/SkewedGroupByTest.scala +++ b/examples/src/main/scala/spark/examples/SkewedGroupByTest.scala @@ -36,6 +36,8 @@ object SkewedGroupByTest { pairs1.count println(pairs1.groupByKey(numReducers).count) + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SparkALS.scala b/examples/src/main/scala/spark/examples/SparkALS.scala index 8ee1418067..59d5154e08 100644 --- a/examples/src/main/scala/spark/examples/SparkALS.scala +++ b/examples/src/main/scala/spark/examples/SparkALS.scala @@ -137,5 +137,7 @@ object SparkALS { println("RMSE = " + rmse(R, ms, us)) println() } + + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SparkHdfsLR.scala b/examples/src/main/scala/spark/examples/SparkHdfsLR.scala index f4cb8f7903..13b6ec1d3f 100644 --- a/examples/src/main/scala/spark/examples/SparkHdfsLR.scala +++ b/examples/src/main/scala/spark/examples/SparkHdfsLR.scala @@ -47,5 +47,6 @@ object SparkHdfsLR { } println("Final w: " + w) + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SparkKMeans.scala b/examples/src/main/scala/spark/examples/SparkKMeans.scala index a153679ab3..5eb1c95a16 100644 --- a/examples/src/main/scala/spark/examples/SparkKMeans.scala +++ b/examples/src/main/scala/spark/examples/SparkKMeans.scala @@ -69,5 +69,6 @@ object SparkKMeans { } println("Final centers: " + kPoints) + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SparkLR.scala b/examples/src/main/scala/spark/examples/SparkLR.scala index 207d936a15..7715e5a713 100644 --- a/examples/src/main/scala/spark/examples/SparkLR.scala +++ b/examples/src/main/scala/spark/examples/SparkLR.scala @@ -45,5 +45,6 @@ object SparkLR { } println("Final w: " + w) + System.exit(0) } } diff --git a/examples/src/main/scala/spark/examples/SparkPi.scala b/examples/src/main/scala/spark/examples/SparkPi.scala index 4cce3c6f36..751fef6ab0 100644 --- a/examples/src/main/scala/spark/examples/SparkPi.scala +++ b/examples/src/main/scala/spark/examples/SparkPi.scala @@ -19,5 +19,6 @@ object SparkPi { if (x*x + y*y < 1) 1 else 0 }.reduce(_ + _) println("Pi is roughly " + 4.0 * count / n) + System.exit(0) } }