aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2011-12-14 18:19:43 +0100
committerMatei Zaharia <matei@eecs.berkeley.edu>2011-12-14 18:19:43 +0100
commit3034fc0d91955062f01a2d198200a3b84d2761bc (patch)
treeb9cd4b0b232715816f3eda9355a531d421a44edb /examples
parent6a650cbbdf7d64d9a79d8dcfe7850e1d678413e0 (diff)
parentad4ebff42c1b738746b2b9ecfbb041b6d06e3e16 (diff)
downloadspark-3034fc0d91955062f01a2d198200a3b84d2761bc.tar.gz
spark-3034fc0d91955062f01a2d198200a3b84d2761bc.tar.bz2
spark-3034fc0d91955062f01a2d198200a3b84d2761bc.zip
Merge commit 'ad4ebff42c1b738746b2b9ecfbb041b6d06e3e16'
Diffstat (limited to 'examples')
-rw-r--r--examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala b/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala
new file mode 100644
index 0000000000..46f658eab2
--- /dev/null
+++ b/examples/src/main/scala/spark/examples/ExceptionHandlingTest.scala
@@ -0,0 +1,18 @@
+package spark.examples
+
+import spark.SparkContext
+
+object ExceptionHandlingTest {
+ def main(args: Array[String]) {
+ if (args.length == 0) {
+ System.err.println("Usage: ExceptionHandlingTest <host>")
+ System.exit(1)
+ }
+
+ val sc = new SparkContext(args(0), "ExceptionHandlingTest")
+ sc.parallelize(0 until sc.defaultParallelism).foreach { i =>
+ if (Math.random > 0.75)
+ throw new Exception("Testing exception handling")
+ }
+ }
+}