Hello,
I try to use Berkeley DB to store a lot of KV.The software must index a lot of data (put/get) and then wait for resquest from user (get) or new information for the index (put/get).
During the big indexing phase, It should be great if Berkeley DB add all data in memory (with cache) and write it manually on disk (with a sync()) from time to time.
So I was looking for a "setDeferredWrite" method like in Berkley DB Java Edition.
I found this post:
6504264
So I try to do "EnvironmentConfig.setTxnNoSync(true)" with:
envConfig_ = new EnvironmentConfig();
envConfig_.setAllowCreate(true);
envConfig_.setInitializeCache(true);
envConfig_.setTransactional(false);
envConfig_.setTxnNoSync(true);
But I get an error message for an invalid argument:
+ incompatible with existing environment+
createEnv: java.lang.IllegalArgumentException: Invalid argument
java.lang.IllegalArgumentException: Invalid argument
at com.sleepycat.db.internal.db_javaJNI.DbEnv_open(Native Method)
at com.sleepycat.db.internal.DbEnv.open(DbEnv.java:248)
at com.sleepycat.db.EnvironmentConfig.openEnvironment(EnvironmentConfig.java:830)
at com.sleepycat.db.Environment.<init>(Environment.java:30)
at person.Env.createEnv(Env.java:67)
at person.Main.main(Main.java:25)
1. Are there other config information to change?
2. With setCachesize and setTxnNoSync, BDB will put everything in cache memory (if enough) without writing on disk? Are there other fields to change to add a lot of data during big indexing phase very quickly?
Thanks a lot