K
- The type of the vertex key (the vertex identifier).VV
- The type of the vertex value (the state of the vertex).EV
- The type of the values that are associated with the edges.Message
- The type of the message sent between vertices along the edges.@FunctionalInterface public interface ComputeFunction<K,VV,EV,Message>
Modifier and Type | Interface and Description |
---|---|
static class |
ComputeFunction.Aggregators |
static class |
ComputeFunction.Callback<K,VV,EV,Message> |
static class |
ComputeFunction.InitCallback |
static class |
ComputeFunction.MasterCallback |
static interface |
ComputeFunction.ReadAggregators |
static interface |
ComputeFunction.ReadWriteAggregators |
Modifier and Type | Method and Description |
---|---|
void |
compute(int superstep,
VertexWithValue<K,VV> vertex,
Iterable<Message> messages,
Iterable<EdgeWithValue<K,EV>> edges,
ComputeFunction.Callback<K,VV,EV,Message> cb)
The function for computing a new vertex value or sending messages to the next superstep.
|
default void |
init(Map<String,?> configs,
ComputeFunction.InitCallback cb)
Initialize the ComputeFunction, this is the place to register aggregators.
|
default void |
masterCompute(int superstep,
ComputeFunction.MasterCallback cb)
A function for performing sequential computations between supersteps.
|
default void |
postSuperstep(int superstep,
ComputeFunction.Aggregators aggregators)
Finish computation.
|
default void |
preSuperstep(int superstep,
ComputeFunction.Aggregators aggregators)
Prepare for computation.
|
default void init(Map<String,?> configs, ComputeFunction.InitCallback cb)
configs
- configuration parameterscb
- a callback for registering aggregatorsdefault void masterCompute(int superstep, ComputeFunction.MasterCallback cb)
superstep
- the superstepcb
- a callback for writing to aggregators or halting the computationdefault void preSuperstep(int superstep, ComputeFunction.Aggregators aggregators)
superstep
- the superstepaggregators
- the aggregatorsvoid compute(int superstep, VertexWithValue<K,VV> vertex, Iterable<Message> messages, Iterable<EdgeWithValue<K,EV>> edges, ComputeFunction.Callback<K,VV,EV,Message> cb)
superstep
- the count of the current superstepvertex
- the current vertex with its valuemessages
- a Map of the source vertex and the message sent from the previous superstepedges
- the adjacent edges with their valuescb
- a callback for setting a new vertex value or sending messages to the next superstepdefault void postSuperstep(int superstep, ComputeFunction.Aggregators aggregators)
superstep
- the superstepaggregators
- the aggregatorsCopyright © 2020. All rights reserved.