aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2012-09-30 22:52:16 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2012-09-30 22:52:16 -0700
commit2314132d57878152a84325f86ea320bdbc7cca31 (patch)
treee85b29055cd145ffdefa9f67bc815dff96303a5f
parent3128c57f9031541d1b77e763b614751b536847b0 (diff)
downloadspark-2314132d57878152a84325f86ea320bdbc7cca31.tar.gz
spark-2314132d57878152a84325f86ea320bdbc7cca31.tar.bz2
spark-2314132d57878152a84325f86ea320bdbc7cca31.zip
Added a (failing) test for LRU with MEMORY_AND_DISK.
-rw-r--r--core/src/main/scala/spark/storage/BlockManager.scala4
-rw-r--r--core/src/test/scala/spark/storage/BlockManagerSuite.scala10
2 files changed, 9 insertions, 5 deletions
diff --git a/core/src/main/scala/spark/storage/BlockManager.scala b/core/src/main/scala/spark/storage/BlockManager.scala
index 5384274d65..a66f812662 100644
--- a/core/src/main/scala/spark/storage/BlockManager.scala
+++ b/core/src/main/scala/spark/storage/BlockManager.scala
@@ -65,8 +65,8 @@ class BlockManager(val master: BlockManagerMaster, val serializer: Serializer, m
private val locker = new BlockLocker(NUM_LOCKS)
private val blockInfo = new ConcurrentHashMap[String, BlockInfo]()
- private val memoryStore: BlockStore = new MemoryStore(this, maxMemory)
- private val diskStore: BlockStore = new DiskStore(this,
+ private[storage] val memoryStore: BlockStore = new MemoryStore(this, maxMemory)
+ private[storage] val diskStore: BlockStore = new DiskStore(this,
System.getProperty("spark.local.dir", System.getProperty("java.io.tmpdir")))
val connectionManager = new ConnectionManager(0)
diff --git a/core/src/test/scala/spark/storage/BlockManagerSuite.scala b/core/src/test/scala/spark/storage/BlockManagerSuite.scala
index c5e0f7be06..d15d7285a7 100644
--- a/core/src/test/scala/spark/storage/BlockManagerSuite.scala
+++ b/core/src/test/scala/spark/storage/BlockManagerSuite.scala
@@ -128,9 +128,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
store.putSingle("a1", a1, StorageLevel.DISK_ONLY)
store.putSingle("a2", a2, StorageLevel.DISK_ONLY)
store.putSingle("a3", a3, StorageLevel.DISK_ONLY)
- assert(store.getSingle("a2") != None, "a2 was not in store")
- assert(store.getSingle("a3") != None, "a3 was not in store")
- assert(store.getSingle("a1") != None, "a1 was not in store")
+ assert(store.getSingle("a2") != None, "a2 was in store")
+ assert(store.getSingle("a3") != None, "a3 was in store")
+ assert(store.getSingle("a1") != None, "a1 was in store")
}
test("disk and memory storage") {
@@ -144,7 +144,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
Thread.sleep(100)
assert(store.getSingle("a2") != None, "a2 was not in store")
assert(store.getSingle("a3") != None, "a3 was not in store")
+ assert(store.memoryStore.getValues("a1") == None, "a1 was in memory store")
assert(store.getSingle("a1") != None, "a1 was not in store")
+ assert(store.memoryStore.getValues("a1") != None, "a1 was not in memory store")
}
test("disk and memory storage with serialization") {
@@ -158,7 +160,9 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
Thread.sleep(100)
assert(store.getSingle("a2") != None, "a2 was not in store")
assert(store.getSingle("a3") != None, "a3 was not in store")
+ assert(store.memoryStore.getValues("a1") == None, "a1 was in memory store")
assert(store.getSingle("a1") != None, "a1 was not in store")
+ assert(store.memoryStore.getValues("a1") != None, "a1 was not in memory store")
}
test("LRU with mixed storage levels") {