我在我的程序中有一個長時間的迭代,我想緩存和檢查點每隔幾次迭代(這種技術建議在網上削減長沿襲),所以我不會有StackOverflowError,通過這樣做Spark無效的檢查點目錄
for (i <- 2 to 100) {
//cache and checkpoint ever 30 iterations
if (i % 30 == 0) {
graph.cache
graph.checkpoint
//I use numEdges in order to start the transformation I need
graph.numEdges
}
//graphs are stored to a list
//here I use the graph of previous iteration to this iteration
//and perform a transformation
}
。我將這樣
val sc = new SparkContext(conf)
sc.setCheckpointDir("checkpoints/")
檢查點目錄然而,當我終於運行我的程序我得到一個異常
Exception in thread "main" org.apache.spark.SparkException: Invalid checkpoint directory
我使用3臺計算機,每臺計算機都安裝了Ubuntu 14.04,而且我還在每臺計算機上使用hadoop 2.4或更高版本的Spark 1.4.1的預建版本。
是否有任何其他方式或者我需要對我的節點HDFS設置?此外「hdfs:// [whatDoIputHere]」,如果我有hdfs安裝什麼目錄我確切地使用? –
你不需要HDFS(它需要HDFS兼容,但也有其他的可能性)。如果你有HDFS設置,它應該是一個沒有任何重要內容的目錄。 – Holden