Skip to content
Snippets Groups Projects
Commit 3db1e17b authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #620 from jerryshao/master

Fix CheckpointRDD java.io.FileNotFoundException when calling getPreferredLocations
parents 3d4891d9 bd3ea8f2
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ class CheckpointRDD[T: ClassManifest](sc: SparkContext, val checkpointPath: Stri
checkpointData.get.cpFile = Some(checkpointPath)
override def getPreferredLocations(split: Partition): Seq[String] = {
val status = fs.getFileStatus(new Path(checkpointPath))
val status = fs.getFileStatus(new Path(checkpointPath, CheckpointRDD.splitIdToFile(split.index)))
val locations = fs.getFileBlockLocations(status, 0, status.getLen)
locations.headOption.toList.flatMap(_.getHosts).filter(_ != "localhost")
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment