Skip to content

Commit 9af51c4

Browse files
author
Davies Liu
committed
Merge branch 'kafka' of github.com:davies/spark into kafka
2 parents a74da87 + dc1eed0 commit 9af51c4

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

examples/src/main/python/streaming/kafka_wordcount.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@
1919
Counts words in UTF8 encoded, '\n' delimited text received from the network every second.
2020
Usage: network_wordcount.py <zk> <topic>
2121
22-
To run this on your local machine, you need to setup Kafka and create a producer first
23-
$ bin/zookeeper-server-start.sh config/zookeeper.properties
24-
$ bin/kafka-server-start.sh config/server.properties
25-
$ bin/kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --topic test
26-
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
27-
22+
To run this on your local machine, you need to setup Kafka and create a producer first, see
23+
http://kafka.apache.org/documentation.html#quickstart
24+
2825
and then run the example
2926
`$ bin/spark-submit --driver-class-path external/kafka-assembly/target/scala-*/\
3027
spark-streaming-kafka-assembly-*.jar examples/src/main/python/streaming/kafka_wordcount.py \
@@ -39,7 +36,7 @@
3936

4037
if __name__ == "__main__":
4138
if len(sys.argv) != 3:
42-
print >> sys.stderr, "Usage: network_wordcount.py <zk> <topic>"
39+
print >> sys.stderr, "Usage: kafka_wordcount.py <zk> <topic>"
4340
exit(-1)
4441

4542
sc = SparkContext(appName="PythonStreamingKafkaWordCount")

python/pyspark/streaming/kafka.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def getClassByName(name):
7474
# TODO: use --jar once it also work on driver
7575
if not e.message or 'call a package' in e.message:
7676
print "No kafka package, please put the assembly jar into classpath:"
77-
print " $ bin/submit --driver-class-path external/kafka-assembly/target/" + \
77+
print " $ bin/spark-submit --driver-class-path external/kafka-assembly/target/" + \
7878
"scala-*/spark-streaming-kafka-assembly-*.jar"
7979
raise e
8080
ser = PairDeserializer(NoOpSerializer(), NoOpSerializer())

0 commit comments

Comments
 (0)