Permalink
Browse files

Merge branch 'master' into akka-actors

  • Loading branch information...
2 parents 87b1f42 + a633974 commit d95a8321efe723b679f0d7877bb099b14ae64aea @mateiz mateiz committed Apr 9, 2012
Showing with 12 additions and 0 deletions.
  1. +1 −0 core/src/main/scala/spark/BoundedMemoryCache.scala
  2. +11 −0 core/src/main/scala/spark/CacheTracker.scala
@@ -70,5 +70,6 @@ class BoundedMemoryCache extends Cache with Logging {
protected def dropEntry(key: Any, entry: Entry) {
logInfo("Dropping key %s of size %d to make space".format(key, entry.size))
+ SparkEnv.get.cacheTracker.dropEntry(key)
}
}
@@ -130,6 +130,17 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging {
}
}
+ // Reports that an entry has been dropped from the cache
+ def dropEntry(key: Any) {
+ key match {
+ case (keySpaceId: Long, (rddId: Int, partition: Int)) =>
+ val host = System.getProperty("spark.hostname", Utils.localHostName)
+ trackerActor !! DroppedFromCache(rddId, partition, host)
+ case _ =>
+ logWarning("Unknown key format: %s".format(key))
+ }
+ }
+
def stop() {
(trackerActor ? StopCacheTracker).get
registeredRddIds.clear()

0 comments on commit d95a832

Please sign in to comment.