K - the vertex ID typeVV - the vertex value typeM - the input type (produced by the Sum phase)public abstract class ApplyFunction<K,VV,M> extends Object implements Serializable
GatherSumApplyIteration.| Constructor and Description |
|---|
ApplyFunction() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
apply(M newValue,
VV currentValue)
This method is invoked once per superstep, after the
SumFunction
in a GatherSumApplyIteration. |
<T> Collection<T> |
getBroadcastSet(String name)
Gets the broadcast data set registered under the given name.
|
<T extends org.apache.flink.api.common.aggregators.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 org.apache.flink.types.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(org.apache.flink.api.common.functions.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.
|
void |
setOutput(Vertex<K,VV> vertex,
org.apache.flink.util.Collector<Vertex<K,VV>> out) |
void |
setResult(VV result)
Sets the result for the apply function.
|
public long getNumberOfVertices()
IterationConfiguration.setOptNumVertices(boolean)
option has been set; -1 otherwise.public abstract void apply(M newValue, VV currentValue)
SumFunction
in a GatherSumApplyIteration.
It updates the Vertex values.newValue - the value computed during the current superstep.currentValue - the current Vertex value.public void setResult(VV result)
result - the result of the apply phasepublic void preSuperstep()
public void postSuperstep()
public int getSuperstepNumber()
public <T extends org.apache.flink.api.common.aggregators.Aggregator<?>> T getIterationAggregator(String name)
name - The name of the aggregator.public <T extends org.apache.flink.types.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(org.apache.flink.api.common.functions.IterationRuntimeContext iterationRuntimeContext)
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.