提交 84e4616a authored 作者: Thomas Mueller's avatar Thomas Mueller

The page size for new databases can now be set in the database URL using ;PAGE_SIZE=512.

上级 36c69f54
...@@ -79,7 +79,7 @@ public class ConnectionInfo implements Cloneable { ...@@ -79,7 +79,7 @@ public class ConnectionInfo implements Cloneable {
String[] connectionTime = { "ACCESS_MODE_DATA", "AUTOCOMMIT", "CIPHER", String[] connectionTime = { "ACCESS_MODE_DATA", "AUTOCOMMIT", "CIPHER",
"CREATE", "CACHE_TYPE", "DB_CLOSE_ON_EXIT", "FILE_LOCK", "IGNORE_UNKNOWN_SETTINGS", "IFEXISTS", "CREATE", "CACHE_TYPE", "DB_CLOSE_ON_EXIT", "FILE_LOCK", "IGNORE_UNKNOWN_SETTINGS", "IFEXISTS",
"INIT", "PASSWORD", "RECOVER", "USER", "AUTO_SERVER", "INIT", "PASSWORD", "RECOVER", "USER", "AUTO_SERVER",
"AUTO_RECONNECT", "OPEN_NEW" }; "AUTO_RECONNECT", "OPEN_NEW", "PAGE_SIZE" };
for (String key : connectionTime) { for (String key : connectionTime) {
if (SysProperties.CHECK && set.contains(key)) { if (SysProperties.CHECK && set.contains(key)) {
DbException.throwInternalError(key); DbException.throwInternalError(key);
......
...@@ -165,8 +165,10 @@ public class Database implements DataHandler { ...@@ -165,8 +165,10 @@ public class Database implements DataHandler {
private volatile boolean metaTablesInitialized; private volatile boolean metaTablesInitialized;
private boolean flushOnEachCommit; private boolean flushOnEachCommit;
private LobStorage lobStorage; private LobStorage lobStorage;
private int pageSize = SysProperties.PAGE_SIZE;
public Database(String name, ConnectionInfo ci, String cipher) { public Database(ConnectionInfo ci, String cipher) {
String name = ci.getName();
this.compareMode = CompareMode.getInstance(null, 0); this.compareMode = CompareMode.getInstance(null, 0);
this.persistent = ci.isPersistent(); this.persistent = ci.isPersistent();
this.filePasswordHash = ci.getFilePasswordHash(); this.filePasswordHash = ci.getFilePasswordHash();
...@@ -179,6 +181,7 @@ public class Database implements DataHandler { ...@@ -179,6 +181,7 @@ public class Database implements DataHandler {
this.accessModeData = ci.getProperty("ACCESS_MODE_DATA", "rw").toLowerCase(); this.accessModeData = ci.getProperty("ACCESS_MODE_DATA", "rw").toLowerCase();
this.autoServerMode = ci.getProperty("AUTO_SERVER", false); this.autoServerMode = ci.getProperty("AUTO_SERVER", false);
this.cacheSize = ci.getProperty("CACHE_SIZE", SysProperties.CACHE_SIZE_DEFAULT); this.cacheSize = ci.getProperty("CACHE_SIZE", SysProperties.CACHE_SIZE_DEFAULT);
this.pageSize = ci.getProperty("PAGE_SIZE", SysProperties.PAGE_SIZE);
if ("r".equals(accessModeData)) { if ("r".equals(accessModeData)) {
readOnly = true; readOnly = true;
} }
...@@ -1922,6 +1925,9 @@ public class Database implements DataHandler { ...@@ -1922,6 +1925,9 @@ public class Database implements DataHandler {
if (eventListener != null) { if (eventListener != null) {
eventListener.opened(); eventListener.opened();
} }
if (writer != null) {
writer.startThread();
}
} }
public void setMode(Mode mode) { public void setMode(Mode mode) {
...@@ -2026,6 +2032,9 @@ public class Database implements DataHandler { ...@@ -2026,6 +2032,9 @@ public class Database implements DataHandler {
public PageStore getPageStore() { public PageStore getPageStore() {
if (pageStore == null) { if (pageStore == null) {
pageStore = new PageStore(this, databaseName + Constants.SUFFIX_PAGE_FILE, accessModeData, cacheSize); pageStore = new PageStore(this, databaseName + Constants.SUFFIX_PAGE_FILE, accessModeData, cacheSize);
if (pageSize != SysProperties.PAGE_SIZE) {
pageStore.setPageSize(pageSize);
}
pageStore.open(); pageStore.open();
} }
return pageStore; return pageStore;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论