Skip to content

Commit bcb3db2

Browse files
authored
Update StackOverFlowSurveyFollowUp.java
1 parent f3f4fe0 commit bcb3db2

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
return splits[2].equals("Canada");
4448

4549
});

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy