提交 deb380fd authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore bugfixes

上级 9d296708
...@@ -270,13 +270,11 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> { ...@@ -270,13 +270,11 @@ public class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
if (contains(p, i, key)) { if (contains(p, i, key)) {
Page c = copyOnWrite(p.getChildPage(i), writeVersion); Page c = copyOnWrite(p.getChildPage(i), writeVersion);
Object result = set(c, writeVersion, key, value); Object result = set(c, writeVersion, key, value);
if (result == null) { if (result != null) {
throw DataUtils.newIllegalStateException( p.setChild(i, c);
DataUtils.ERROR_INTERNAL, "Key did not exist"); p.setCounts(i, c);
return result;
} }
p.setChild(i, c);
p.setCounts(i, c);
return result;
} }
} }
} else { } else {
......
...@@ -115,7 +115,7 @@ public class TestMemoryUsage extends TestBase { ...@@ -115,7 +115,7 @@ public class TestMemoryUsage extends TestBase {
stat.execute("INSERT INTO TEST(DATA) SELECT SPACE(8000) FROM SYSTEM_RANGE(1, 800)"); stat.execute("INSERT INTO TEST(DATA) SELECT SPACE(8000) FROM SYSTEM_RANGE(1, 800)");
freeSoftReferences(); freeSoftReferences();
int used = Utils.getMemoryUsed(); int used = Utils.getMemoryUsed();
if ((used - base) > 16000) { if ((used - base) > 3 * 8192) {
fail("Used: " + (used - base) + " i: " + i); fail("Used: " + (used - base) + " i: " + i);
} }
} }
......
...@@ -513,7 +513,7 @@ public class TestMVStore extends TestBase { ...@@ -513,7 +513,7 @@ public class TestMVStore extends TestBase {
s.store(); s.store();
s.close(); s.close();
int[] expectedReadsForCacheSize = { int[] expectedReadsForCacheSize = {
3406, 2590, 1924, 1440, 1108, 956, 918 3405, 2590, 1924, 1440, 1108, 956, 918
}; };
for (int cacheSize = 0; cacheSize <= 6; cacheSize += 4) { for (int cacheSize = 0; cacheSize <= 6; cacheSize += 4) {
s = new MVStore.Builder(). s = new MVStore.Builder().
...@@ -1032,7 +1032,7 @@ public class TestMVStore extends TestBase { ...@@ -1032,7 +1032,7 @@ public class TestMVStore extends TestBase {
assertEquals(i + 1, m.size()); assertEquals(i + 1, m.size());
} }
assertEquals(1000, m.size()); assertEquals(1000, m.size());
assertEquals(286, s.getUnsavedPageCount()); assertEquals(285, s.getUnsavedPageCount());
s.store(); s.store();
assertEquals(2, s.getFileStore().getWriteCount()); assertEquals(2, s.getFileStore().getWriteCount());
s.close(); s.close();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论