提交 89d87ece authored 作者: Thomas Mueller's avatar Thomas Mueller

Database files now grow 2 MB at a time instead of 256 KB.

上级 a6c53fd4
...@@ -121,7 +121,7 @@ public class PageStore implements CacheWriter { ...@@ -121,7 +121,7 @@ public class PageStore implements CacheWriter {
private static final int PAGE_ID_FREE_LIST_ROOT = 3; private static final int PAGE_ID_FREE_LIST_ROOT = 3;
private static final int PAGE_ID_META_ROOT = 4; private static final int PAGE_ID_META_ROOT = 4;
private static final int MIN_PAGE_COUNT = 6; private static final int MIN_PAGE_COUNT = 6;
private static final int INCREMENT_PAGES = 128; private static final int INCREMENT_KB = 2048;
private static final int READ_VERSION = 3; private static final int READ_VERSION = 3;
private static final int WRITE_VERSION = 3; private static final int WRITE_VERSION = 3;
private static final int META_TYPE_DATA_INDEX = 0; private static final int META_TYPE_DATA_INDEX = 0;
...@@ -291,7 +291,7 @@ public class PageStore implements CacheWriter { ...@@ -291,7 +291,7 @@ public class PageStore implements CacheWriter {
log.openForWriting(logFirstTrunkPage, false); log.openForWriting(logFirstTrunkPage, false);
isNew = true; isNew = true;
recoveryRunning = false; recoveryRunning = false;
increaseFileSize(INCREMENT_PAGES); increaseFileSize(INCREMENT_KB * 1024 / pageSize);
} }
private void openExisting() { private void openExisting() {
...@@ -878,7 +878,7 @@ public class PageStore implements CacheWriter { ...@@ -878,7 +878,7 @@ public class PageStore implements CacheWriter {
synchronized (database) { synchronized (database) {
int p = PAGE_ID_FREE_LIST_ROOT + i * freeListPagesPerList; int p = PAGE_ID_FREE_LIST_ROOT + i * freeListPagesPerList;
while (p >= pageCount) { while (p >= pageCount) {
increaseFileSize(INCREMENT_PAGES); increaseFileSize(INCREMENT_KB * 1024 / pageSize);
} }
if (p < pageCount) { if (p < pageCount) {
list = (PageFreeList) getPage(p); list = (PageFreeList) getPage(p);
...@@ -955,7 +955,7 @@ public class PageStore implements CacheWriter { ...@@ -955,7 +955,7 @@ public class PageStore implements CacheWriter {
} }
} }
if (page >= pageCount) { if (page >= pageCount) {
increaseFileSize(INCREMENT_PAGES); increaseFileSize(INCREMENT_KB * 1024 / pageSize);
} }
if (trace.isDebugEnabled()) { if (trace.isDebugEnabled()) {
// trace.debug("allocatePage " + pos); // trace.debug("allocatePage " + pos);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论