diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-04-08 23:41:36 -0700 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-04-08 23:41:36 -0700 |
commit | a69c0738d137c0ab8adeef548ed0c7ad34587bc3 (patch) | |
tree | 5f59676f1ce8a4461799d17d1b2e5c3ea8050205 /core | |
parent | 0229d5390f3fe6a84a744feb23ea6a9a458ebe1b (diff) | |
parent | a6339741433ec74e06adc8e876eed163e69706f9 (diff) | |
download | spark-a69c0738d137c0ab8adeef548ed0c7ad34587bc3.tar.gz spark-a69c0738d137c0ab8adeef548ed0c7ad34587bc3.tar.bz2 spark-a69c0738d137c0ab8adeef548ed0c7ad34587bc3.zip |
Merge branch 'master' into mesos-0.9
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/BoundedMemoryCache.scala | 1 | ||||
-rw-r--r-- | core/src/main/scala/spark/CacheTracker.scala | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/core/src/main/scala/spark/BoundedMemoryCache.scala b/core/src/main/scala/spark/BoundedMemoryCache.scala index ccf55d66af..e8e50ac360 100644 --- a/core/src/main/scala/spark/BoundedMemoryCache.scala +++ b/core/src/main/scala/spark/BoundedMemoryCache.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) } } diff --git a/core/src/main/scala/spark/CacheTracker.scala b/core/src/main/scala/spark/CacheTracker.scala index 5e9a70cc7e..5b6eed743f 100644 --- a/core/src/main/scala/spark/CacheTracker.scala +++ b/core/src/main/scala/spark/CacheTracker.scala @@ -143,6 +143,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 registeredRddIds.clear() |