I am trying to implement a lambda Function2 in Java:
JavaPairRDD<String, Integer> reducedCounts = counts.reduceByKey(new Function2<Integer, Integer, Integer>() {
@Override
public Integer call(final Integer value0, final Integer value1) {
return Integer.valueOf(value0.intValue() + value1.intValue());
}
});
The above is a sample, but how to change it to a lamb8 format? I wanna define as a separate function
Function2<...> f2 = LAMBDA;
counts.reduceByKey(f2);
counts.reduceByKey( (x,y) -> x + y)