Skip to content

Commit

Permalink
update logging and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Jan 22, 2015
1 parent 33730d1 commit 2c567a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions examples/src/main/python/streaming/kafka_wordcount.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions python/pyspark/streaming/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2c567a5

Please sign in to comment.