我是spark graphx的新手,是否有任何方法可以从res中查找vertexId列表的邻居?除了使用
的迭代val graph = Graph(vertexRDD, relation)
graph.edges.take(10).foreach(println(_))
graph.vertices.take(10).foreach(println(_))
val res = graph.vertices.filter { case s: GOODSProperty => s.flag == 1
case _ => true
}
val direction: EdgeDirection =EdgeDirection.Both
graph.collectNeighborIds(direction).lookup(vertexId)
例如,如果我想这样做
start_id(a list of id)->all_neighbour
then all_neighbour->next_neighbour
then next_neighbor->nextnext_neighbor
查找是执行此操作的最佳方式吗?