Github user shghatge commented on the pull request:
https://github.com/apache/flink/pull/892#issuecomment-128866366
I made some of the changes mentioned. But there was a problem in replacing
the getTriplets() and flatMap. When I use this method
private static final class ReduceN implements
NeighborsFunctionWithVertexValue<Long,Tuple2<Double, HashSet<Long>> ,Double,
Tuple3<Long, Long, Double>> {
@Override
public void iterateNeighbors(
Vertex<Long, Tuple2<Double, HashSet<Long>>>
vertex,
Iterable<Tuple2<Edge<Long, Double>,
Vertex<Long, Tuple2<Double, HashSet<Long>>>>> neighbors,
Collector<Tuple3<Long, Long, Double>> out)
throws Exception {
for(Tuple2<Edge<Long, Double>, Vertex<Long,
Tuple2<Double, HashSet<Long>>>> neighbor : neighbors) {
HashSet<Long> intersection =
vertex.getValue().f1;
intersection.retainAll(neighbor.f1.getValue().f1);
for(long l : intersection) {
System.out.println(neighbor.f1.getId()+" "+l);
out.collect(new Tuple3<Long,
Long, Double>(neighbor.f1.getId(), l, vertex.getValue().f0));
}
}
}
}
For some reason the
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---