[SPARK-19003][DOCS] Add Java example in Spark Streaming Guide, section Design Patterns for using foreachRDD#16408
Closed
adesharatushar wants to merge 2 commits into
Closed
Conversation
srowen
requested changes
Dec 27, 2016
| <div data-lang="java" markdown="1"> | ||
| {% highlight java %} | ||
| dstream.foreachRDD(new VoidFunction<JavaRDD<String>>() { | ||
| @Override public void call(JavaRDD<String> rdd) throws Exception { |
Member
There was a problem hiding this comment.
Nits:
@Override
public ...
Don't throws Exception; remove or make more specific.
Extra space before new on next line.
| @Override public void call(JavaRDD<String> rdd) throws Exception { | ||
| rdd.foreach(new VoidFunction<String>() { | ||
| @Override public void call(String record) throws Exception { | ||
| Connection connection = new Connection(connectionString); |
Member
There was a problem hiding this comment.
Why is this different from the Scala example?
| {% highlight java %} | ||
| dstream.foreachRDD(new VoidFunction<JavaRDD<String>>() { | ||
| @Override public void call(JavaRDD<String> rdd) throws Exception { | ||
| final Connection connection = new Connection(connectionString); // executed at the driver |
Member
There was a problem hiding this comment.
Why make this different from Scala?
Contributor
Author
|
Thanks @srowen for review and comments, made changes and committed on branch. |
srowen
approved these changes
Dec 28, 2016
|
Test build #3518 has finished for PR 16408 at commit
|
Member
|
Merged to master/2.1 |
asfgit
pushed a commit
that referenced
this pull request
Dec 29, 2016
…n Design Patterns for using foreachRDD ## What changes were proposed in this pull request? Added missing Java example under section "Design Patterns for using foreachRDD". Now this section has examples in all 3 languages, improving consistency of documentation. ## How was this patch tested? Manual. Generated docs using command "SKIP_API=1 jekyll build" and verified generated HTML page manually. The syntax of example has been tested for correctness using sample code on Java1.7 and Spark 2.2.0-SNAPSHOT. Author: adesharatushar <tushar_adeshara@persistent.com> Closes #16408 from adesharatushar/streaming-doc-fix. (cherry picked from commit dba81e1) Signed-off-by: Sean Owen <sowen@cloudera.com>
cmonkey
pushed a commit
to cmonkey/spark
that referenced
this pull request
Dec 30, 2016
…n Design Patterns for using foreachRDD ## What changes were proposed in this pull request? Added missing Java example under section "Design Patterns for using foreachRDD". Now this section has examples in all 3 languages, improving consistency of documentation. ## How was this patch tested? Manual. Generated docs using command "SKIP_API=1 jekyll build" and verified generated HTML page manually. The syntax of example has been tested for correctness using sample code on Java1.7 and Spark 2.2.0-SNAPSHOT. Author: adesharatushar <tushar_adeshara@persistent.com> Closes apache#16408 from adesharatushar/streaming-doc-fix.
uzadude
pushed a commit
to uzadude/spark
that referenced
this pull request
Jan 27, 2017
…n Design Patterns for using foreachRDD ## What changes were proposed in this pull request? Added missing Java example under section "Design Patterns for using foreachRDD". Now this section has examples in all 3 languages, improving consistency of documentation. ## How was this patch tested? Manual. Generated docs using command "SKIP_API=1 jekyll build" and verified generated HTML page manually. The syntax of example has been tested for correctness using sample code on Java1.7 and Spark 2.2.0-SNAPSHOT. Author: adesharatushar <tushar_adeshara@persistent.com> Closes apache#16408 from adesharatushar/streaming-doc-fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Added missing Java example under section "Design Patterns for using foreachRDD". Now this section has examples in all 3 languages, improving consistency of documentation.
How was this patch tested?
Manual.
Generated docs using command "SKIP_API=1 jekyll build" and verified generated HTML page manually.
The syntax of example has been tested for correctness using sample code on Java1.7 and Spark 2.2.0-SNAPSHOT.