Edge Class
1
case class Edge[ED](srcId: VertexId = 0, dstId: VertexId = 0, attr: ED = null.asInstanceOf[ED]) extends Serializable with Product
Copied!
An Instance Constructor
1
new
2
Edge(srcId: VertexId = 0, dstId: VertexId = 0, attr: ED = null.asInstanceOf[ED])
Copied!
A single directed edge consisting of a source id, target id, and the data associated with the edge.
srcId The vertex id of the source vertex
dstId The vertex id of the target vertex
attr The attribute associated with the edge

Example:

1
val relationships: RDD[Edge[String]] = sc.parallelize(Array(Edge(1L, 2L, "boss"), Edge(1L, 3L, "boss"),
2
Edge(2L, 3L, "coworker"), Edge(4L, 1L, "boss")))Reference:
Copied!
Last modified 1yr ago
Copy link