Skip to content
Snippets Groups Projects
Commit 12ff0d2d authored by Ankur Dave's avatar Ankur Dave
Browse files

Bring an entry back into memory after fetching it from disk

parent e30313aa
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
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