public static <K, V1, V2, V3> PTable<K, Tuple3.Collect<V1, V2, V3>> cogroup(
int numReducers,
PTable<K, V1> first,
PTable<K, V2> second,
PTable<K, V3> third) {
return cogroup(
Tuple3.Collect.derived(first.getValueType(), second.getValueType(), third.getValueType()),
new TupleFactory<Tuple3.Collect<V1, V2, V3>>() {
@Override
public Tuple3.Collect<V1, V2, V3> makeTuple(Object... values) {
return new Tuple3.Collect<V1, V2, V3>(
(Collection<V1>) values[0],
(Collection<V2>) values[1],
(Collection<V3>) values[2]);
}
},
numReducers,
first, second, third);
}