diff options
-rw-r--r-- | streaming/src/test/java/spark/streaming/JavaAPISuite.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/streaming/src/test/java/spark/streaming/JavaAPISuite.java b/streaming/src/test/java/spark/streaming/JavaAPISuite.java index 551d4f15e4..9bfcd83e4d 100644 --- a/streaming/src/test/java/spark/streaming/JavaAPISuite.java +++ b/streaming/src/test/java/spark/streaming/JavaAPISuite.java @@ -528,7 +528,7 @@ public class JavaAPISuite implements Serializable { new PairFunction<Tuple2<String, Integer>, Integer, String>() { @Override public Tuple2<Integer, String> call(Tuple2<String, Integer> in) throws Exception { - return new Tuple2(in._2(), in._1()); + return in.swap(); } }); @@ -563,7 +563,7 @@ public class JavaAPISuite implements Serializable { LinkedList<Tuple2<Integer, String>> out = new LinkedList<Tuple2<Integer, String>>(); while (in.hasNext()) { Tuple2<String, Integer> next = in.next(); - out.add(new Tuple2<Integer, String>(next._2(), next._1())); + out.add(next.swap()); } return out; } |