diff options
author | Ankur Dave <ankurdave@gmail.com> | 2011-04-27 22:59:05 -0700 |
---|---|---|
committer | Ankur Dave <ankurdave@gmail.com> | 2011-04-27 22:59:05 -0700 |
commit | 12ff0d2dc30547052e4c364e5cb9a2f4641651da (patch) | |
tree | 0dd34c4bba74805d4c1f0fd356d320ad75947028 /core | |
parent | e30313aa2cd7ebb0108147b972770b610cc89092 (diff) | |
download | spark-12ff0d2dc30547052e4c364e5cb9a2f4641651da.tar.gz spark-12ff0d2dc30547052e4c364e5cb9a2f4641651da.tar.bz2 spark-12ff0d2dc30547052e4c364e5cb9a2f4641651da.zip |
Bring an entry back into memory after fetching it from disk
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/scala/spark/DiskSpillingCache.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/main/scala/spark/DiskSpillingCache.scala b/core/src/main/scala/spark/DiskSpillingCache.scala index c40159d66e..06359254b9 100644 --- a/core/src/main/scala/spark/DiskSpillingCache.scala +++ b/core/src/main/scala/spark/DiskSpillingCache.scala @@ -27,6 +27,7 @@ class DiskSpillingCache extends BoundedMemoryCache { val timeTaken = System.currentTimeMillis - startTime logInfo("Reading key %s of size %d bytes from disk took %d ms".format( key, file.length, timeTaken)) + super.put(key, bytes) ser.deserialize(bytes.asInstanceOf[Array[Byte]]) case _ => // not found @@ -42,9 +43,8 @@ class DiskSpillingCache extends BoundedMemoryCache { } /** - * Spill least recently used entries to disk until at least space - * bytes are free. Assumes that a lock is held on the DiskSpillingCache. - * Assumes that entry.value is a byte array. + * Spill the given entry to disk. Assumes that a lock is held on the + * DiskSpillingCache. Assumes that entry.value is a byte array. */ override protected def dropEntry(key: Any, entry: Entry) { logInfo("Spilling key %s of size %d to make space".format( |