Skip to content
Snippets Groups Projects
Commit 31a70400 authored by jianghan's avatar jianghan Committed by Patrick Wendell
Browse files

Fix example bug: compile error

Author: jianghan <jianghan@xiaomi.com>

Closes #132 from pooorman/master and squashes the following commits:

54afbe0 [jianghan] Fix example bug: compile error
parent 9032f7c0
No related branches found
No related tags found
No related merge requests found
...@@ -124,7 +124,7 @@ public final class JavaLogQuery { ...@@ -124,7 +124,7 @@ public final class JavaLogQuery {
List<Tuple2<Tuple3<String, String, String>, Stats>> output = counts.collect(); List<Tuple2<Tuple3<String, String, String>, Stats>> output = counts.collect();
for (Tuple2<?,?> t : output) { for (Tuple2<?,?> t : output) {
System.out.println(t._1 + "\t" + t._2); System.out.println(t._1() + "\t" + t._2());
} }
System.exit(0); System.exit(0);
} }
......
...@@ -90,8 +90,8 @@ public final class JavaPageRank { ...@@ -90,8 +90,8 @@ public final class JavaPageRank {
@Override @Override
public Iterable<Tuple2<String, Double>> call(Tuple2<List<String>, Double> s) { public Iterable<Tuple2<String, Double>> call(Tuple2<List<String>, Double> s) {
List<Tuple2<String, Double>> results = new ArrayList<Tuple2<String, Double>>(); List<Tuple2<String, Double>> results = new ArrayList<Tuple2<String, Double>>();
for (String n : s._1) { for (String n : s._1()) {
results.add(new Tuple2<String, Double>(n, s._2 / s._1.size())); results.add(new Tuple2<String, Double>(n, s._2() / s._1().size()));
} }
return results; return results;
} }
...@@ -109,7 +109,7 @@ public final class JavaPageRank { ...@@ -109,7 +109,7 @@ public final class JavaPageRank {
// Collects all URL ranks and dump them to console. // Collects all URL ranks and dump them to console.
List<Tuple2<String, Double>> output = ranks.collect(); List<Tuple2<String, Double>> output = ranks.collect();
for (Tuple2<?,?> tuple : output) { for (Tuple2<?,?> tuple : output) {
System.out.println(tuple._1 + " has rank: " + tuple._2 + "."); System.out.println(tuple._1() + " has rank: " + tuple._2() + ".");
} }
System.exit(0); System.exit(0);
......
...@@ -65,7 +65,7 @@ public final class JavaWordCount { ...@@ -65,7 +65,7 @@ public final class JavaWordCount {
List<Tuple2<String, Integer>> output = counts.collect(); List<Tuple2<String, Integer>> output = counts.collect();
for (Tuple2<?,?> tuple : output) { for (Tuple2<?,?> tuple : output) {
System.out.println(tuple._1 + ": " + tuple._2); System.out.println(tuple._1() + ": " + tuple._2());
} }
System.exit(0); System.exit(0);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment