Package org.apache.spark.graphx
Class EdgeContext<VD,ED,A>
Object
org.apache.spark.graphx.EdgeContext<VD,ED,A>
- Direct Known Subclasses:
AggregatingEdgeContext
Represents an edge along with its neighboring vertices and allows sending messages along the
edge. Used in
Graph.aggregateMessages(scala.Function1<org.apache.spark.graphx.EdgeContext<VD, ED, A>, scala.runtime.BoxedUnit>, scala.Function2<A, A, A>, org.apache.spark.graphx.TripletFields, scala.reflect.ClassTag<A>)
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract ED
attr()
The attribute associated with the edge.abstract VD
dstAttr()
The vertex attribute of the edge's destination vertex.abstract long
dstId()
The vertex id of the edge's destination vertex.abstract void
Sends a message to the destination vertex.abstract void
Sends a message to the source vertex.abstract VD
srcAttr()
The vertex attribute of the edge's source vertex.abstract long
srcId()
The vertex id of the edge's source vertex.Converts the edge and vertex properties into anEdgeTriplet
for convenience.unapply
(EdgeContext<VD, ED, A> edge) Extractor mainly used for Graph#aggregateMessages*.
-
Constructor Details
-
EdgeContext
public EdgeContext()
-
-
Method Details
-
unapply
public static <VD,ED, scala.Some<scala.Tuple5<Object,A> Object, unapplyVD, VD, ED>> (EdgeContext<VD, ED, A> edge) Extractor mainly used for Graph#aggregateMessages*. Example:val messages = graph.aggregateMessages( case ctx @ EdgeContext(_, _, _, _, attr) => ctx.sendToDst(attr) , _ + _)
- Parameters:
edge
- (undocumented)- Returns:
- (undocumented)
-
srcId
public abstract long srcId()The vertex id of the edge's source vertex. -
dstId
public abstract long dstId()The vertex id of the edge's destination vertex. -
srcAttr
The vertex attribute of the edge's source vertex. -
dstAttr
The vertex attribute of the edge's destination vertex. -
attr
The attribute associated with the edge. -
sendToSrc
Sends a message to the source vertex. -
sendToDst
Sends a message to the destination vertex. -
toEdgeTriplet
Converts the edge and vertex properties into anEdgeTriplet
for convenience.
-