我正在使用GraphX运行以下代码片段:
val g = Graph(
v.persist(StorageLevel.MEMORY_AND_DISK_SER),
e.persist(StorageLevel.MEMORY_AND_DISK_SER),
1,
StorageLevel.MEMORY_AND_DISK_SER,
StorageLevel.MEMORY_AND_DISK_SER)
val pageRankResult = g.pageRank(0.0001)
我在运行时收到警告:
[WARN - org.apache.spark.graphx.impl.ShippableVertexPartitionOps] - Diffing two VertexPartitions with different indexes is slow.
和
[WARN - org.apache.spark.graphx.impl.ShippableVertexPartitionOps] - Joining two VertexPartitions with different indexes is slow.
我阅读了主题的答案 通过unpersist graph在Spark和GraphX中加入具有不同索引的两个顶点分区很慢,但就我而言,一切都被持久化了。
我做错了什么?
不得使用带有_SER
后缀的存储级别来利用VertexPartitions
的快速 zip 联接。
从MEMORY_AND_DISK_SER
级别切换到MEMORY_AND_DISK
级别可能会增加计算时间(并且您将不再看到警告(,但缓存的数据将占用更多空间。