From 2c567a5d55c465d706026c2395e9025fad9dbd68 Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Thu, 22 Jan 2015 00:01:02 -0800 Subject: [PATCH] update logging and comment --- examples/src/main/python/streaming/kafka_wordcount.py | 7 ++++--- python/pyspark/streaming/kafka.py | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/src/main/python/streaming/kafka_wordcount.py b/examples/src/main/python/streaming/kafka_wordcount.py index 8b9ae9903aacb..dad760aa4db54 100644 --- a/examples/src/main/python/streaming/kafka_wordcount.py +++ b/examples/src/main/python/streaming/kafka_wordcount.py @@ -22,12 +22,13 @@ To run this on your local machine, you need to setup Kafka and create a producer first $ bin/zookeeper-server-start.sh config/zookeeper.properties $ bin/kafka-server-start.sh config/server.properties + $ bin/kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --topic test $ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test and then run the example - `$ bin/spark-submit --driver-class-path lib_managed/jars/kafka_*.jar:\ - external/kafka/target/scala-*/spark-streaming-kafka_*.jar examples/src/main/python/\ - streaming/kafka_wordcount.py localhost:2181 test` + `$ bin/spark-submit --driver-class-path external/kafka-assembly/target/scala-*/\ + spark-streaming-kafka-assembly-*.jar examples/src/main/python/streaming/kafka_wordcount.py \ + localhost:2181 test` """ import sys diff --git a/python/pyspark/streaming/kafka.py b/python/pyspark/streaming/kafka.py index f52d0b535094f..2e898c06fcf8f 100644 --- a/python/pyspark/streaming/kafka.py +++ b/python/pyspark/streaming/kafka.py @@ -73,10 +73,9 @@ def getClassByName(name): except Py4JError, e: # TODO: use --jar once it also work on driver if not e.message or 'call a package' in e.message: - print "No kafka package, please build it and add it into classpath:" - print " $ sbt/sbt streaming-kafka/package" - print " $ bin/submit --driver-class-path lib_managed/jars/kafka_2.10-0.8.0.jar:" \ - "external/kafka/target/scala-2.10/spark-streaming-kafka_2.10-1.3.0-SNAPSHOT.jar" + print "No kafka package, please put the assembly jar into classpath:" + print " $ bin/submit --driver-class-path external/kafka-assembly/target/" + \ + "scala-*/spark-streaming-kafka-assembly-*.jar" raise e ser = PairDeserializer(NoOpSerializer(), NoOpSerializer()) stream = DStream(jstream, ssc, ser)