Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/242#discussion_r11380428
--- Diff:
examples/src/main/java/org/apache/spark/examples/JavaPageRank.java ---
@@ -86,12 +87,18 @@ public Double call(List<String> rs) {
for (int current = 0; current < Integer.parseInt(args[2]); current++) {
// Calculates URL contributions to the rank of other URLs.
JavaPairRDD<String, Double> contribs = links.join(ranks).values()
- .flatMapToPair(new PairFlatMapFunction<Tuple2<List<String>,
Double>, String, Double>() {
+ .flatMapToPair(new PairFlatMapFunction<Tuple2<Iterable<String>,
Double>, String, Double>() {
@Override
- public Iterable<Tuple2<String, Double>>
call(Tuple2<List<String>, Double> s) {
+ public Iterable<Tuple2<String, Double>>
call(Tuple2<Iterable<String>, Double> s) {
+ int urlCount = 0;
+ Iterator<String> urls = s._1.iterator();
+ while (urls.hasNext()) {
--- End diff --
could you use `Iterators.size` here too?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---