0
有沒有辦法在運行某個部分期間減少內核/執行程序的數量?我們不想超出最終數據存儲區,但需要更多的內核來有效地執行計算工作。Apache Spark:在執行期間減少內核數量
基本上
// want n cores here
val eventJsonRdd: RDD[(String,(Event, Option[Article]))] = eventGeoRdd.leftOuterJoin(articlesRdd)
val toSave = eventJsonRdd.map(processEventsAndArticlesJson)
// want two cores here
toSave.saveToEs("apollobit/events")
會測試出來。謝謝! – chrislovecnm 2014-09-03 20:45:18
foreachPartition的語法是什麼? – chrislovecnm 2014-09-03 20:49:35
http://spark.apache.org/docs/latest/api/scala/index.html#org.apache.spark.rdd.RDD 類似... .foreachPartition {iterator => saveThemAll(iterator)} – 2014-09-03 20:54:56