Skip to content

Commit

Permalink
Switch envConfig to use full geometry settings instead of just mapSize
Browse files Browse the repository at this point in the history
  • Loading branch information
castortech committed Dec 16, 2021
1 parent 2bdcc4e commit 9c80452
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mdbxjni/src/main/java/com/castortech/mdbxjni/Env.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
48 changes: 47 additions & 1 deletion mdbxjni/src/main/java/com/castortech/mdbxjni/EnvConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 9c80452

Please sign in to comment.