Merge pull request #620 from jerryshao/master

Fix CheckpointRDD java.io.FileNotFoundException when calling getPreferredLocations
This commit is contained in:
Matei Zaharia 2013-05-27 21:31:43 -07:00
Родитель 3d4891d9fb bd3ea8f2a6
Коммит 3db1e17baa
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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")
}