try {
LMDBOptions options = new LMDBOptions();
options.createIfMissing(true);
options.openFlags(NOSYNC); // this test would run too slow without this.
LMDB db = (LMDB) factory.open(getTestDirectory(getName()), options);
WriteOptions op = new WriteOptions();
for (int i = 0; i < 1024 * 100; i++) {
byte[] key = ByteBuffer.allocate(4).putInt(i).array();
byte[] value = ByteBuffer.allocate(1024).putInt(-i).array();
db.put(key, value, op);
assertTrue(Arrays.equals(db.get(key), value));
}
System.out.println(db.getEnv().info());
System.out.println(db.getEnv().stat());
System.out.println(db.getDatabase().stat());
db.close();
} finally {
LMDBFactory.popMemoryPool();
}
}