diff --git a/mdbxjni/src/main/java/com/castortech/mdbxjni/Env.java b/mdbxjni/src/main/java/com/castortech/mdbxjni/Env.java index bf1f79a..4b54678 100644 --- a/mdbxjni/src/main/java/com/castortech/mdbxjni/Env.java +++ b/mdbxjni/src/main/java/com/castortech/mdbxjni/Env.java @@ -284,9 +284,8 @@ public void open(String path, EnvConfig config) { setMaxReaders(config.getMaxReaders()); } - if (config.getMapSize() != -1) { - setMapSize(config.getMapSize()); - } + setGeometry(config.getMapLower(), config.getMapSize(), config.getMapUpper(), config.getMapGrowth(), + config.getMapShrink(), config.getPageSize()); int rc = mdbx_env_open(pointer(), path, flags, config.getMode()); if (rc != 0) { diff --git a/mdbxjni/src/main/java/com/castortech/mdbxjni/EnvConfig.java b/mdbxjni/src/main/java/com/castortech/mdbxjni/EnvConfig.java index 82d682a..0304aef 100644 --- a/mdbxjni/src/main/java/com/castortech/mdbxjni/EnvConfig.java +++ b/mdbxjni/src/main/java/com/castortech/mdbxjni/EnvConfig.java @@ -21,7 +21,13 @@ public class EnvConfig implements Cloneable { private int mode = 0644; //this is octal private int maxReaders = -1; private long maxDbs = -1; - private long mapSize = -1; + private long pageSize = -1; + + private long mapLower = -1; + private long mapSize = -1; //represents geo now + private long mapUpper = -1; + private long mapGrowth = -1; + private long mapShrink = -1; public int getMode() { return mode; @@ -47,6 +53,22 @@ public void setMaxDbs(long maxDbs) { this.maxDbs = maxDbs; } + public long getPageSize() { + return pageSize; + } + + public void setPageSize(long pageSize) { + this.pageSize = pageSize; + } + + public long getMapLower() { + return mapLower; + } + + public void setMapLower(long mapLower) { + this.mapLower = mapLower; + } + public long getMapSize() { return mapSize; } @@ -55,6 +77,30 @@ public void setMapSize(long mapSize) { this.mapSize = mapSize; } + public long getMapUpper() { + return mapUpper; + } + + public void setMapUpper(long mapUpper) { + this.mapUpper = mapUpper; + } + + public long getMapGrowth() { + return mapGrowth; + } + + public void setMapGrowth(long mapGrowth) { + this.mapGrowth = mapGrowth; + } + + public long getMapShrink() { + return mapShrink; + } + + public void setMapShrink(long mapShrink) { + this.mapShrink = mapShrink; + } + public boolean isNoSubDir() { return noSubDir; }