From 66106c17b97cf69c9e3779b373277c2da3e8f2c2 Mon Sep 17 00:00:00 2001 From: Matthew Wise Date: Sat, 28 May 2016 21:29:02 -0700 Subject: [PATCH] fix example code issues in documentation --- docs/streaming-kafka-integration.md | 2 +- docs/streaming-programming-guide.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/streaming-kafka-integration.md b/docs/streaming-kafka-integration.md index 0f1e32212eb4..e0d3f4f69be8 100644 --- a/docs/streaming-kafka-integration.md +++ b/docs/streaming-kafka-integration.md @@ -111,7 +111,7 @@ Next, we discuss how to use this approach in your streaming application.
import org.apache.spark.streaming.kafka.*; - JavaPairReceiverInputDStream directKafkaStream = + JavaPairInputDStream directKafkaStream = KafkaUtils.createDirectStream(streamingContext, [key class], [value class], [key decoder class], [value decoder class], [map of Kafka parameters], [set of topics to consume]); diff --git a/docs/streaming-programming-guide.md b/docs/streaming-programming-guide.md index d7eafff38f35..6550fcc0521c 100644 --- a/docs/streaming-programming-guide.md +++ b/docs/streaming-programming-guide.md @@ -145,8 +145,8 @@ import org.apache.spark.streaming.api.java.*; import scala.Tuple2; // Create a local StreamingContext with two working thread and batch interval of 1 second -SparkConf conf = new SparkConf().setMaster("local[2]").setAppName("NetworkWordCount") -JavaStreamingContext jssc = new JavaStreamingContext(conf, Durations.seconds(1)) +SparkConf conf = new SparkConf().setMaster("local[2]").setAppName("NetworkWordCount"); +JavaStreamingContext jssc = new JavaStreamingContext(conf, Durations.seconds(1)); {% endhighlight %} Using this context, we can create a DStream that represents streaming data from a TCP