VV
- the vertex value typeEV
- the edge value typeM
- the output typepublic abstract class SumFunction<VV,EV,M> extends Object implements Serializable
GatherSumApplyIteration
.Constructor and Description |
---|
SumFunction() |
Modifier and Type | Method and Description |
---|---|
<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.
|
abstract M |
sum(M arg0,
M arg1)
This method is invoked once per superstep, after the
GatherFunction in a GatherSumApplyIteration . |
public long getNumberOfVertices()
IterationConfiguration.setOptNumVertices(boolean)
option has been
set; -1 otherwise.public abstract M sum(M arg0, M arg1)
GatherFunction
in a GatherSumApplyIteration
. It combines the partial values produced by GatherFunction.gather(Neighbor)
in pairs, until a single value has been computed.arg0
- the first partial value.arg1
- the second partial value.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–2024 The Apache Software Foundation. All rights reserved.