diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/src/main/scala/spark/examples/CpuHog.scala | 26 | ||||
-rw-r--r-- | examples/src/main/scala/spark/examples/SleepJob.scala | 21 |
2 files changed, 0 insertions, 47 deletions
diff --git a/examples/src/main/scala/spark/examples/CpuHog.scala b/examples/src/main/scala/spark/examples/CpuHog.scala deleted file mode 100644 index 94b3709850..0000000000 --- a/examples/src/main/scala/spark/examples/CpuHog.scala +++ /dev/null @@ -1,26 +0,0 @@ -package spark.examples - -import spark._ - -object CpuHog { - def main(args: Array[String]) { - if (args.length != 3) { - System.err.println("Usage: CpuHog <master> <tasks> <threads_per_task>"); - System.exit(1) - } - val sc = new SparkContext(args(0), "CPU hog") - val tasks = args(1).toInt - val threads = args(2).toInt - def task { - for (i <- 0 until threads-1) { - new Thread() { - override def run { - while(true) {} - } - }.start() - } - while(true) {} - } - sc.runTasks(Array.make(tasks, () => task)) - } -} diff --git a/examples/src/main/scala/spark/examples/SleepJob.scala b/examples/src/main/scala/spark/examples/SleepJob.scala deleted file mode 100644 index 02673a5f88..0000000000 --- a/examples/src/main/scala/spark/examples/SleepJob.scala +++ /dev/null @@ -1,21 +0,0 @@ -package spark.examples - -import spark._ - -object SleepJob { - def main(args: Array[String]) { - if (args.length != 3) { - System.err.println("Usage: SleepJob <master> <tasks> <task_duration>"); - System.exit(1) - } - val sc = new SparkContext(args(0), "Sleep job") - val tasks = args(1).toInt - val duration = args(2).toInt - def task { - val start = System.currentTimeMillis - while (System.currentTimeMillis - start < duration * 1000L) - Thread.sleep(200) - } - sc.runTasks(Array.make(tasks, () => task)) - } -} |