public final class BreadthFirstSearch<K,EV> extends Object implements ComputeFunction<K,Long,EV,Long>
ComputeFunction.Aggregators, ComputeFunction.Callback<K,VV,EV,Message>, ComputeFunction.InitCallback, ComputeFunction.MasterCallback, ComputeFunction.ReadAggregators, ComputeFunction.ReadWriteAggregators
Modifier and Type | Field and Description |
---|---|
static String |
SRC_VERTEX_ID |
static long |
UNVISITED |
Constructor and Description |
---|
BreadthFirstSearch() |
Modifier and Type | Method and Description |
---|---|
void |
compute(int superstep,
VertexWithValue<K,Long> vertex,
Iterable<Long> messages,
Iterable<EdgeWithValue<K,EV>> edges,
ComputeFunction.Callback<K,Long,EV,Long> cb)
The function for computing a new vertex value or sending messages to the next superstep.
|
void |
init(Map<String,?> configs,
ComputeFunction.InitCallback cb)
Initialize the ComputeFunction, this is the place to register aggregators.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
masterCompute, postSuperstep, preSuperstep
public static final String SRC_VERTEX_ID
public static final long UNVISITED
public void init(Map<String,?> configs, ComputeFunction.InitCallback cb)
ComputeFunction
public void compute(int superstep, VertexWithValue<K,Long> vertex, Iterable<Long> messages, Iterable<EdgeWithValue<K,EV>> edges, ComputeFunction.Callback<K,Long,EV,Long> cb)
ComputeFunction
compute
in interface ComputeFunction<K,Long,EV,Long>
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 superstepCopyright © 2020. All rights reserved.