Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcb3db2

Browse files
authored
Update StackOverFlowSurveyFollowUp.java
1 parentf3f4fe0 commitbcb3db2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/main/java/com/sparkTutorial/advanced/accumulator/StackOverFlowSurveyFollowUp.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,20 @@ public static void main(String[] args) throws Exception {
3030

3131
JavaRDD<String>responseFromCanada =responseRDD.filter(response -> {
3232

33+
// update processedBytes accumulator with the size of the current response
3334
processedBytes.add(response.getBytes().length);
34-
35+
36+
// split the reponse using commas.
3537
String[]splits =response.split(Utils.COMMA_DELIMITER, -1);
3638

39+
// increase the total accumulator by 1
3740
total.add(1);
3841

42+
// increase the missingSalaryMidPoint accumulator by 1 if the salary middle point is not present in the reponse
3943
if (splits[14].isEmpty()) {
4044
missingSalaryMidPoint.add(1);
4145
}
42-
46+
// return true if the reponse is from Canada
4347
returnsplits[2].equals("Canada");
4448

4549
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp