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

Merge pull request #119 from mesos/report-cache-events

Report entry dropping in BoundedMemoryCache
parents 816d4e58 7be1c7b3
No related branches found
No related tags found
No related merge requests found
...@@ -70,5 +70,6 @@ class BoundedMemoryCache extends Cache with Logging { ...@@ -70,5 +70,6 @@ class BoundedMemoryCache extends Cache with Logging {
protected def dropEntry(key: Any, entry: Entry) { protected def dropEntry(key: Any, entry: Entry) {
logInfo("Dropping key %s of size %d to make space".format(key, entry.size)) logInfo("Dropping key %s of size %d to make space".format(key, entry.size))
SparkEnv.get.cacheTracker.dropEntry(key)
} }
} }
...@@ -143,6 +143,17 @@ class CacheTracker(isMaster: Boolean, theCache: Cache) extends Logging { ...@@ -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() { def stop() {
trackerActor !? StopCacheTracker trackerActor !? StopCacheTracker
registeredRddIds.clear() registeredRddIds.clear()
......
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