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

MVStore bugfixes

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