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