VV
- the vertex value typeEV
- the edge value typeM
- the output typepublic abstract class GatherFunction<VV,EV,M> extends Object implements Serializable
GatherSumApplyIteration
.Constructor and Description |
---|
GatherFunction() |
Modifier and Type | Method and Description |
---|---|
abstract M |
gather(Neighbor<VV,EV> neighbor)
This method is invoked once per superstep, for each
Neighbor of each Vertex
in the beginning of each superstep in a GatherSumApplyIteration . |
<T> Collection<T> |
getBroadcastSet(String name)
Gets the broadcast data set registered under the given name.
|
<T extends Aggregator<?>> |
getIterationAggregator(String name)
Gets the iteration aggregator registered under the given name.
|
long |
getNumberOfVertices()
Retrieves the number of vertices in the graph.
|
<T extends Value> |
getPreviousIterationAggregate(String name)
Get the aggregated value that an aggregator computed in the previous iteration.
|
int |
getSuperstepNumber()
Gets the number of the superstep, starting at 1.
|
void |
init(IterationRuntimeContext iterationRuntimeContext) |
void |
postSuperstep()
This method is executed once per superstep after the vertex update function has been invoked for each vertex.
|
void |
preSuperstep()
This method is executed once per superstep before the vertex update function is invoked for each vertex.
|
public long getNumberOfVertices()
IterationConfiguration.setOptNumVertices(boolean)
option has been set; -1 otherwise.public abstract M gather(Neighbor<VV,EV> neighbor)
Neighbor
of each Vertex
in the beginning of each superstep in a GatherSumApplyIteration
.
It needs to produce a partial value, which will be combined with other partial value
in the next phase of the iteration.neighbor
- the input Neighbor. It provides access to the source Vertex and the Edge objects.public void preSuperstep()
public void postSuperstep()
public int getSuperstepNumber()
public <T extends Aggregator<?>> T getIterationAggregator(String name)
name
- The name of the aggregator.public <T extends Value> T getPreviousIterationAggregate(String name)
name
- The name of the aggregator.public <T> Collection<T> getBroadcastSet(String name)
name
- The name under which the broadcast set is registered.public void init(IterationRuntimeContext iterationRuntimeContext)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.