AggregateMessages
provides a functional abstraction for aggregating neighborhood information in Spark graphs. This operator applies a user-defined sendMsg
function to each edge in the graph using EdgeContext
. Each EdgeContext
class accesses the required information about the edge and passes that information to its source node and/or destination node using the sendToSrc
and/or sendToDst
methods respectively. After all messages have been received by the nodes, the mergeMsg
function is used to aggregate those messages at each node.
In the next chapter, we will introduce another operator called Pregel
, which will be useful for creating custom iterative graph-processing algorithms.