[DOCS] fix example code issues in documentation

## What changes were proposed in this pull request?

Fixed broken java code examples in streaming documentation

Attn: tdas

Author: Matthew Wise <matthew.rs.wise@gmail.com>

Closes #13388 from mawise/fix_docs_java_streaming_example.
This commit is contained in:
Matthew Wise 2016-05-30 09:12:02 -05:00 committed by Sean Owen
parent 5728aa558e
commit 2d34183b27
2 changed files with 3 additions and 3 deletions

View file

@ -111,7 +111,7 @@ Next, we discuss how to use this approach in your streaming application.
<div data-lang="java" markdown="1">
import org.apache.spark.streaming.kafka.*;
JavaPairReceiverInputDStream<String, String> directKafkaStream =
JavaPairInputDStream<String, String> directKafkaStream =
KafkaUtils.createDirectStream(streamingContext,
[key class], [value class], [key decoder class], [value decoder class],
[map of Kafka parameters], [set of topics to consume]);

View file

@ -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