Commit 397c99b0 authored by 张彦钊's avatar 张彦钊

change test file

parent c1b3e72b
......@@ -175,7 +175,6 @@ def write_to_kafka():
except kafka_errors as e:
print(str(e))
def Ctr(rdd):
try:
results = rdd
......@@ -197,7 +196,8 @@ def m_decoder(s):
if __name__ == '__main__':
# Spark-Streaming-Kafka
sc = SparkContext(conf=SparkConf().setMaster("spark://nvwa01:7077").setAppName("kafka_test").set("spark.io.compression.codec", "lzf"))
sc = SparkContext(conf=SparkConf().setMaster("spark://nvwa01:7077").setAppName("kafka_test")
.set("spark.io.compression.codec", "lzf"))
ssc = SQLContext(sc)
ssc = StreamingContext(sc, 10)
sc.setLogLevel("WARN")
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment