-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[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
Conversation
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>"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Looks like a good doc fix. It's nontrivial, so could you file a JIRA for it and make the title |
* org.apache.spark.examples.streaming.JavaStatefulNetworkWordCount localhost 9999` | ||
*/ | ||
public class JavaStatefulNetworkWordCount { | ||
private static final Pattern SPACE = Pattern.compile(" "); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and changed.
OK to test |
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> |
There was a problem hiding this comment.
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.
Test build #27481 has started for PR 4589 at commit
|
Test build #27481 has finished for PR 4589 at commit
|
Test PASSed. |
Test build #27485 has started for PR 4589 at commit
|
Test build #27485 has finished for PR 4589 at commit
|
Test PASSed. |
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. |
…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
That patch had a line break in the middle of a {{ }} expression, which is not allowed.
That patch had a line break in the middle of a {{ }} expression, which is not allowed.
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.