Skip to content

Commit

Permalink
Allow spilling cached tables to disk.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Nov 22, 2012
1 parent 1a360a7 commit 31a7dab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/scala/shark/CacheManager.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package shark

import spark.RDD
import spark.storage.StorageLevel
import scala.collection.mutable.HashMap


Expand All @@ -13,7 +14,7 @@ case class CacheKey(val keyStr: String) {
case _ => false
}
}

override def hashCode(): Int = {
key.hashCode()
}
Expand All @@ -25,7 +26,7 @@ class CacheManager {

def put(key: CacheKey, rdd: RDD[_]) {
keyToRdd(key) = rdd
rdd.cache()
rdd.persist(StorageLevel.MEMORY_AND_DISK)
}

def get(key: CacheKey): Option[RDD[_]] = {
Expand All @@ -34,7 +35,7 @@ class CacheManager {
case None => None
}
}

/**
* Find all keys that are strings. Used to drop tables after exiting.
*/
Expand Down

0 comments on commit 31a7dab

Please sign in to comment.