提交 2e953d00 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore: convert an empty root node to a leaf

上级 30582d72
......@@ -49,6 +49,7 @@ public class TestMVStore extends TestBase {
public void test() throws Exception {
FileUtils.deleteRecursive(getBaseDir(), true);
FileUtils.createDirectories(getBaseDir());
testIsEmpty();
testOffHeapStorage();
testNewerWriteVersion();
testCompactFully();
......@@ -98,6 +99,22 @@ public class TestMVStore extends TestBase {
// longer running tests
testLargerThan2G();
}
private void testIsEmpty() throws Exception {
MVStore s = new MVStore.Builder().
pageSplitSize(50).
open();
Map<Integer, byte[]> m = s.openMap("data");
m.put(1, new byte[50]);
m.put(2, new byte[50]);
m.put(3, new byte[50]);
m.remove(1);
m.remove(2);
m.remove(3);
assertEquals(0, m.size());
assertTrue(m.isEmpty());
s.close();
}
private void testOffHeapStorage() throws Exception {
OffHeapStore offHeap = new OffHeapStore();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论