diff options
author | Prabeesh K <prabsmails@gmail.com> | 2013-10-22 09:05:57 +0530 |
---|---|---|
committer | Prabeesh K <prabsmails@gmail.com> | 2013-10-22 09:05:57 +0530 |
commit | 9ca1bd95305a904637075e4f5747b28571114fb1 (patch) | |
tree | 95406bdb39b45b256db6e5fec01d4faf23a90664 /examples/src | |
parent | dbafa11396d7c1619f5523fba5ae6abed07e90d9 (diff) | |
download | spark-9ca1bd95305a904637075e4f5747b28571114fb1.tar.gz spark-9ca1bd95305a904637075e4f5747b28571114fb1.tar.bz2 spark-9ca1bd95305a904637075e4f5747b28571114fb1.zip |
Update MQTTWordCount.scala
Diffstat (limited to 'examples/src')
-rw-r--r-- | examples/src/main/scala/org/apache/spark/streaming/examples/MQTTWordCount.scala | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/examples/src/main/scala/org/apache/spark/streaming/examples/MQTTWordCount.scala b/examples/src/main/scala/org/apache/spark/streaming/examples/MQTTWordCount.scala index 7d06505df7..af698a01d5 100644 --- a/examples/src/main/scala/org/apache/spark/streaming/examples/MQTTWordCount.scala +++ b/examples/src/main/scala/org/apache/spark/streaming/examples/MQTTWordCount.scala @@ -33,15 +33,13 @@ import org.eclipse.paho.client.mqttv3.MqttTopic * A simple Mqtt publisher for demonstration purposes, repeatedly publishes * Space separated String Message "hello mqtt demo for spark streaming" */ - object MQTTPublisher { var client: MqttClient = _ def main(args: Array[String]) { if (args.length < 2) { - System.err.println( - "Usage: MQTTPublisher <MqttBrokerUrl> <topic>") + System.err.println("Usage: MQTTPublisher <MqttBrokerUrl> <topic>") System.exit(1) } @@ -52,7 +50,6 @@ object MQTTPublisher { client = new MqttClient(brokerUrl, MqttClient.generateClientId(), peristance) } catch { case e: MqttException => println("Exception Caught: " + e) - } client.connect() @@ -66,7 +63,6 @@ object MQTTPublisher { println("Published data. topic: " + msgtopic.getName() + " Message: " + message) } client.disconnect() - } } @@ -87,7 +83,6 @@ object MQTTPublisher { * and run the example as * `$ ./run-example org.apache.spark.streaming.examples.MQTTWordCount local[2] tcp://localhost:1883 foo` */ - object MQTTWordCount { def main(args: Array[String]) { |