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

MVStore: use a different free space algorithm (pluggable now)

上级 065aa507
......@@ -952,7 +952,8 @@ public class MVStore {
// free up the space of unused chunks now
for (Chunk x : removedChunks) {
freeSpace.free(x.start, x.length);
int len = MathUtils.roundUpInt(x.length, BLOCK_SIZE) + BLOCK_SIZE;
freeSpace.free(x.start, len);
}
c.start = filePos;
......@@ -1617,7 +1618,8 @@ public class MVStore {
loadFromFile = true;
do {
last = chunks.remove(lastChunkId);
freeSpace.free(last.start, last.length);
int len = MathUtils.roundUpInt(last.length, BLOCK_SIZE) + BLOCK_SIZE;
freeSpace.free(last.start, len);
lastChunkId--;
} while (last.version > version && chunks.size() > 0);
rootChunkStart = last.start;
......
......@@ -72,6 +72,8 @@ public class TestMVTableEngine extends TestBase {
Connection conn;
Statement stat;
long maxSize = 0;
// TODO does not shrink for 45 seconds;
// need an option to configure that
for (int i = 0; i < 20; i++) {
conn = getConnection(dbName);
stat = conn.createStatement();
......
......@@ -45,7 +45,7 @@ public class TestTransactionStore extends TestBase {
@Override
public void test() throws Exception {
FileUtils.createDirectories(getBaseDir());
// testStopWhileCommitting();
testStopWhileCommitting();
testGetModifiedMaps();
testKeyIterator();
testMultiStatement();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论