Added a test for overly large blocks in memory store

This commit is contained in:
Matei Zaharia 2012-10-02 17:30:40 -07:00
Родитель 6098f7e87a
Коммит 5fda59ab99
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -341,4 +341,13 @@ class BlockManagerSuite extends FunSuite with BeforeAndAfter with PrivateMethodT
assert(stream.read() === -1, "end of stream not signalled")
assert(stream.read(temp, 0, temp.length) === -1, "end of stream not signalled")
}
test("overly large block") {
val store = new BlockManager(master, new KryoSerializer, 500)
store.putSingle("a1", new Array[Byte](1000), StorageLevel.MEMORY_ONLY)
assert(store.getSingle("a1") === None, "a1 was in store")
store.putSingle("a2", new Array[Byte](1000), StorageLevel.MEMORY_AND_DISK)
assert(store.memoryStore.getValues("a2") === None, "a2 was in memory store")
assert(store.getSingle("a2") != None, "a2 was not in store")
}
}