Thank you, Ankur! :)

But how to assign = the storage level to a new vertices RDD that mapped from an existing vertic= es RDD,=C2=A0
e.g.
val newVertexRDD =3D graph.collectNeighborIds(Edg= eDirection.Out).map{case(id:VertexId, a:Array[VertexId]) =3D> (id, initi= alHashMap(a))}

<= div>the new one will be combined with that existing edges R= DD(MEMORY_AND_DISK) to construct a new graph.
e.g.
val newGraph =3D Gr= aph(newVertexRDD, graph.edges)

=

BTW, the return of newVertexRDD.getStorageLevel is StorageLevel(= true, true, false, true, 1), what does it mean?

Best,
Yifan

2014-09-03 22:42 GMT+02:00 Ankur Dave <= ankurdave@gmail.com>:
At 2014-09-03 17:58:09 +0200, Yifan LI <iamyifanli@gmail.com> wrote:
> val graph =3D GraphLoader.edgeListFile(sc, edgesFile, minEdgePartition= s =3D numPartitions).partitionBy(PartitionStrategy.EdgePartition2D).persist= (StorageLevel.MEMORY_AND_DISK)
>
> Error: java.lang.UnsupportedOperationException: Cannot change storage = level
> of an RDD after it was already assigned a level

You have to pass the StorageLevel to GraphLoader.edgeListFile:

=C2=A0 =C2=A0 val graph =3D GraphLoader.edgeListFile(
=C2=A0 =C2=A0 =C2=A0 sc, edgesFile, minEdgePartitions =3D numPartitions, =C2=A0 =C2=A0 =C2=A0 edgeStorageLevel =3D StorageLevel.MEMORY_AND_DISK,
=C2=A0 =C2=A0 =C2=A0 vertexStorageLevel =3D StorageLevel.MEMORY_AND_DISK) =C2=A0 =C2=A0 =C2=A0 .partitionBy(PartitionStrategy.EdgePartition2D)

Ankur

--20cf300e5625d1749f05024eb794--