Skip to content

Commit

Permalink
Fix example bug: compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
jianghan committed Mar 13, 2014
1 parent 16788a6 commit 54afbe0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Stats call(Stats stats, Stats stats2) {

List<Tuple2<Tuple3<String, String, String>, Stats>> output = counts.collect();
for (Tuple2<?,?> t : output) {
System.out.println(t._1 + "\t" + t._2);
System.out.println(t._1() + "\t" + t._2());
}
System.exit(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public Double call(List<String> rs) {
@Override
public Iterable<Tuple2<String, Double>> call(Tuple2<List<String>, Double> s) {
List<Tuple2<String, Double>> results = new ArrayList<Tuple2<String, Double>>();
for (String n : s._1) {
results.add(new Tuple2<String, Double>(n, s._2 / s._1.size()));
for (String n : s._1()) {
results.add(new Tuple2<String, Double>(n, s._2() / s._1().size()));
}
return results;
}
Expand All @@ -109,7 +109,7 @@ public Double call(Double sum) {
// Collects all URL ranks and dump them to console.
List<Tuple2<String, Double>> output = ranks.collect();
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Integer call(Integer i1, Integer i2) {

List<Tuple2<String, Integer>> output = counts.collect();
for (Tuple2<?,?> tuple : output) {
System.out.println(tuple._1 + ": " + tuple._2);
System.out.println(tuple._1() + ": " + tuple._2());
}
System.exit(0);
}
Expand Down

0 comments on commit 54afbe0

Please sign in to comment.