K
- the vertex key typeVV
- the vertex value typeEV
- the edge value typeO
- the type of the return valuepublic interface NeighborsFunctionWithVertexValue<K,VV,EV,O> extends Function, Serializable
Graph.groupReduceOnNeighbors(NeighborsFunctionWithVertexValue, EdgeDirection)
method.Modifier and Type | Method and Description |
---|---|
void |
iterateNeighbors(Vertex<K,VV> vertex,
Iterable<Tuple2<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(Vertex<K,VV> vertex, Iterable<Tuple2<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.
vertex
- the grouping Vertexneighbors
- 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–2021 The Apache Software Foundation. All rights reserved.