Skip to content

Commit

Permalink
Adapt test to use geometry settings instead of mapSize
Browse files Browse the repository at this point in the history
  • Loading branch information
castortech committed Dec 16, 2021
1 parent 9c80452 commit 8d13dac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mdbxjni/src/test/java/com/castortech/mdbxjni/EnvTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ public void testEnvInfo() throws Exception {
String path = tmp.newFolder().getCanonicalPath();
try (Env env = new Env()) {
// env.addFlags(CREATE);
env.setGeometry(1048576L, -1L, 4000L * 1024 * 1024, 1048576L, -1L, -1L);
env.open(path);
env.setMapSize(1048576L);
// env.setMapSize(1048576L);
try (Database db = env.openDatabase()) {
db.put(new byte[]{1}, new byte[]{1});
EnvInfo info = env.info();
Expand Down
3 changes: 2 additions & 1 deletion mdbxjni/src/test/java/com/castortech/mdbxjni/InsertTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void before() throws Exception {
// envConfig.setSafeNoSync(true);
// envConfig.setWriteMap(true);

envConfig.setMapSize(2000L * 1024 * 1024); //2gb
envConfig.setMapGrowth(1000L * 1024 * 1024); //1gb

//nosync
// envConfig.setWriteMap(true);
Expand All @@ -84,7 +86,6 @@ public void before() throws Exception {

env = new Env();
env.setMaxDbs(2);
env.setMapSize(6000L * 1024 * 1024); //4gb
Env.pushMemoryPool(1024*512);
env.open(path, envConfig);
// db = env.openDatabase("primary");
Expand Down

0 comments on commit 8d13dac

Please sign in to comment.