Skip to content

[SPARK-5800] Streaming Docs. Change linked files according the selected language #4589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

gasparms
Copy link
Contributor

Currently, Spark Streaming Programming Guide after updateStateByKey explanation links to file stateful_network_wordcount.py and note "For the complete Scala code ..." for any language tab selected. This is an incoherence.

I've changed the guide and link its pertinent example file. JavaStatefulNetworkWordCount.java example was not created so I added to the commit.

@AmplabJenkins
Copy link

Can one of the admins verify this patch?


public static void main(String[] args) {
if (args.length < 2) {
System.err.println("Usage: StatefulNetworkWordCount <hostname> <port>");
Copy link
Member

Choose a reason for hiding this comment

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

Update this class name too. Ideally, I think this example should be a verbatim merge of JavaNetworkWordCount with the difference between Scala NetworkWordCount and StatefulNetworkWordCount. It's not quite structured like the latter, but it's close. I wonder if you could rearrange it a little bit so that the symmetry is obvious.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What name do you suggest? I named JavaStatefulNetworkWordCount.java like exists StatefulNetworkWordCount for Scala and stateful_network_wordcount.py for Python.

I've removed throw exception and open a JIRA.

On the other hand, I've adapt the example to look like Scala example.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I'm referring to the class name in the usage message. That should be changed too.

@srowen
Copy link
Member

srowen commented Feb 13, 2015

Looks like a good doc fix. It's nontrivial, so could you file a JIRA for it and make the title SPARK-xxxx [DOCS] ...?

@gasparms gasparms changed the title Fix Streaming Guide Docs. Change linked files according the selected language [SPARK-5800] Streaming Docs. Change linked files according the selected language Feb 13, 2015
* org.apache.spark.examples.streaming.JavaStatefulNetworkWordCount localhost 9999`
*/
public class JavaStatefulNetworkWordCount {
private static final Pattern SPACE = Pattern.compile(" ");
Copy link
Member

Choose a reason for hiding this comment

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

It also looks like you used 4-space indent throughout, whereas spark uses 2-space.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you and changed.

@srowen
Copy link
Member

srowen commented Feb 13, 2015

OK to test

@srowen
Copy link
Member

srowen commented Feb 14, 2015

ok to test


// Initial RDD input to updateStateByKey
JavaPairRDD<String, Integer> initialRDD = ssc.sc()
.parallelizePairs(Arrays.asList(new Tuple2<String, Integer>("hello", 1), new Tuple2<String, Integer>
Copy link
Member

Choose a reason for hiding this comment

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

I think this line may be too long; Jenkins will tell you with the style checker, which you can run too. The wrapping is strange. I'd re-flow this so that you're not breaking a constructor and its args! Maybe pull out a variable for the list of tuples.

@SparkQA
Copy link

SparkQA commented Feb 14, 2015

Test build #27481 has started for PR 4589 at commit ec202b0.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 14, 2015

Test build #27481 has finished for PR 4589 at commit ec202b0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • public class JavaStatefulNetworkWordCount

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27481/
Test PASSed.

@SparkQA
Copy link

SparkQA commented Feb 14, 2015

Test build #27485 has started for PR 4589 at commit 7f37f89.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Feb 14, 2015

Test build #27485 has finished for PR 4589 at commit 7f37f89.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • public class JavaStatefulNetworkWordCount

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27485/
Test PASSed.

@srowen
Copy link
Member

srowen commented Feb 14, 2015

OK, this still has an instance of the same formatting issue, and a line that might be too long, but I believe I can touch it up on merge.

@asfgit asfgit closed this in f80e262 Feb 14, 2015
asfgit pushed a commit that referenced this pull request Feb 14, 2015
…ed language

Currently, Spark Streaming Programming Guide after updateStateByKey  explanation links to file stateful_network_wordcount.py and note "For the complete Scala code ..." for any language tab selected. This is an incoherence.

I've changed the guide and link its pertinent example file. JavaStatefulNetworkWordCount.java example was not created so I added to the commit.

Author: gasparms <gmunoz@stratio.com>

Closes #4589 from gasparms/feature/streaming-guide and squashes the following commits:

7f37f89 [gasparms] More style changes
ec202b0 [gasparms] Follow spark style guide
f527328 [gasparms] Improve example to look like scala example
4d8785c [gasparms] Remove throw exception
e92e6b8 [gasparms] Fix incoherence
92db405 [gasparms] Fix Streaming Programming Guide. Change files according the selected language
asfgit pushed a commit that referenced this pull request Feb 16, 2015
That patch had a line break in the middle of a {{ }} expression, which is not allowed.
asfgit pushed a commit that referenced this pull request Feb 16, 2015
That patch had a line break in the middle of a {{ }} expression, which is not allowed.
@gasparms gasparms deleted the feature/streaming-guide branch February 17, 2015 10:52
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.

4 participants