Examples of LMDB


Examples of org.fusesource.lmdbjni.leveldb.LMDB

        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();
        }

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.