Skip to content

Conversation

@adesharatushar
Copy link
Contributor

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.

<div data-lang="java" markdown="1">
{% highlight java %}
dstream.foreachRDD(new VoidFunction<JavaRDD<String>>() {
@Override public void call(JavaRDD<String> rdd) throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make this different from Scala?

@adesharatushar
Copy link
Contributor Author

Thanks @srowen for review and comments, made changes and committed on branch.

@SparkQA
Copy link

SparkQA commented Dec 28, 2016

Test build #3518 has finished for PR 16408 at commit ebb5e5d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Dec 29, 2016

Merged to master/2.1

@asfgit asfgit closed this in dba81e1 Dec 29, 2016
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 <[email protected]>

Closes #16408 from adesharatushar/streaming-doc-fix.

(cherry picked from commit dba81e1)
Signed-off-by: Sean Owen <[email protected]>
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 <[email protected]>

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 <[email protected]>

Closes apache#16408 from adesharatushar/streaming-doc-fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants