envConfig.setTransactional(true);
envConfig.setAllowCreate(false);
envConfig.setReadOnly(false);
envConfig.setCacheSize(1024 * 1024 * 1024);
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setTransactional(true);
dbConfig.setAllowCreate(false);
dbConfig.setSortedDuplicates(areDuplicatesNeededForSrc());
dbConfig.setReadOnly(true);
srcEnv = new Environment(new File(sourceEnvPath), envConfig);
srcDB = srcEnv.openDatabase(null, storeName, dbConfig);
// Configure dest environment handle
File newEnvDir = new File(destEnvPath);
if(!newEnvDir.exists()) {
newEnvDir.mkdirs();
}
envConfig = new EnvironmentConfig();
envConfig.setTransactional(false);
envConfig.setAllowCreate(true);
envConfig.setReadOnly(false);
envConfig.setCacheSize(1024 * 1024 * 1024);
envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX,
Long.toString(logFileSize * 1024L * 1024L));
envConfig.setDurability(Durability.COMMIT_NO_SYNC);
dbConfig = new DatabaseConfig();
dbConfig.setTransactional(false);
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(areDuplicatesNeededForDest());
dbConfig.setDeferredWrite(true);
dbConfig.setNodeMaxEntries(nodeMax);
dstEnv = new Environment(newEnvDir, envConfig);
dstDB = dstEnv.openDatabase(null, storeName, dbConfig);
}