Skip to content
Snippets Groups Projects
Commit feadaf72 authored by Charles Reiss's avatar Charles Reiss
Browse files

Mark key as not loading in CacheTracker even when compute() fails

parent 3f74f729
No related branches found
No related tags found
No related merge requests found
...@@ -202,26 +202,26 @@ private[spark] class CacheTracker(actorSystem: ActorSystem, isMaster: Boolean, b ...@@ -202,26 +202,26 @@ private[spark] class CacheTracker(actorSystem: ActorSystem, isMaster: Boolean, b
loading.add(key) loading.add(key)
} }
} }
// If we got here, we have to load the split
// Tell the master that we're doing so
//val host = System.getProperty("spark.hostname", Utils.localHostName)
//val future = trackerActor !! AddedToCache(rdd.id, split.index, host)
// TODO: fetch any remote copy of the split that may be available
// TODO: also register a listener for when it unloads
logInfo("Computing partition " + split)
val elements = new ArrayBuffer[Any]
elements ++= rdd.compute(split, context)
try { try {
// If we got here, we have to load the split
// Tell the master that we're doing so
//val host = System.getProperty("spark.hostname", Utils.localHostName)
//val future = trackerActor !! AddedToCache(rdd.id, split.index, host)
// TODO: fetch any remote copy of the split that may be available
// TODO: also register a listener for when it unloads
val elements = new ArrayBuffer[Any]
logInfo("Computing partition " + split)
elements ++= rdd.compute(split, context)
// Try to put this block in the blockManager // Try to put this block in the blockManager
blockManager.put(key, elements, storageLevel, true) blockManager.put(key, elements, storageLevel, true)
//future.apply() // Wait for the reply from the cache tracker //future.apply() // Wait for the reply from the cache tracker
return elements.iterator.asInstanceOf[Iterator[T]]
} finally { } finally {
loading.synchronized { loading.synchronized {
loading.remove(key) loading.remove(key)
loading.notifyAll() loading.notifyAll()
} }
} }
return elements.iterator.asInstanceOf[Iterator[T]]
} }
} }
......
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