Skip to content
Snippets Groups Projects
Commit 2d34183b authored by Matthew Wise's avatar Matthew Wise Committed by Sean Owen
Browse files

[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.
parent 5728aa55
No related branches found
No related tags found
No related merge requests found
......@@ -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]);
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment