K
- the vertex key typeVV
- the vertex value typeEV
- the edge value typeO
- the type of the return valuepublic interface NeighborsFunction<K,VV,EV,O> extends Function, Serializable
Graph.groupReduceOnNeighbors(NeighborsFunction, EdgeDirection)
method.Modifier and Type | Method and Description |
---|---|
void |
iterateNeighbors(Iterable<Tuple3<K,Edge<K,EV>,Vertex<K,VV>>> neighbors,
Collector<O> out)
This method is called per vertex and can iterate over all of its neighbors with the specified
direction.
|
void iterateNeighbors(Iterable<Tuple3<K,Edge<K,EV>,Vertex<K,VV>>> neighbors, Collector<O> out) throws Exception
If called with EdgeDirection.OUT
the group will contain the out-edges and
neighboring vertices of the grouping vertex. If called with EdgeDirection.IN
the
group will contain the in-edges and neighboring vertices of the grouping vertex. If called
with EdgeDirection.ALL
the group will contain all edges and neighboring vertices of
the grouping vertex.
The method can emit any number of output elements, including none.
neighbors
- the neighbors of the grouping vertex. The first filed of each Tuple3 is the
ID of the grouping vertex. The second field is the neighboring edge, and the third field
is the neighboring vertex.out
- the collector to emit results toException
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.