---------- Forwarded message ----------
From: Ranjana Rajendran <[email protected]>
Date: Thu, Aug 13, 2015 at 7:37 AM
Subject: Graphx - how to add vertices to a HashSet of vertices ?
To: [email protected]
Hi,
sampledVertices is a HashSet of vertices
var sampledVertices: HashSet[VertexId] = HashSet()
In each iteration, I am making a list of neighborVertexIds
val neighborVertexIds = burnEdges.map((e:Edge[Int]) => e.dstId)
I want to add this neighborVertexIds to the sampledVertices Hashset.
What is the best way to do this ?
Currently, I have
sampledVertices = sampledVertices ++ neighborVertexIds.toArray
I realize, toArray is making this a separate stage.
What will be the most efficient way to achieve this ?
Similarly, I need to add the neighborVertexIds to burnQueue where burnQueue
is is a queue of vertices
var burnQueue: Queue[VertexId] = Queue()
Thank you,
Ranjana