From 12ff0d2dc30547052e4c364e5cb9a2f4641651da Mon Sep 17 00:00:00 2001 From: Ankur Dave Date: Wed, 27 Apr 2011 22:59:05 -0700 Subject: Bring an entry back into memory after fetching it from disk --- core/src/main/scala/spark/DiskSpillingCache.scala | 6 +++--- 1 file 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( -- cgit v1.2.3