Package org.xtreemfs.babudb.api.database

Examples of org.xtreemfs.babudb.api.database.DatabaseRO.lookup()


        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
        Iterator<Entry<byte[], byte[]>> it = snap1.prefixLookup(0, null, null).get();
        Entry<byte[], byte[]> next = it.next();
        assertEquals("test", new String(next.getKey()));
        assertEquals("v2", new String(next.getValue()));
View Full Code Here


        // create a checkpoint
        database.getCheckpointer().checkpoint();
       
        // check whether the snapshot contains exactly the specified key-value
        // pairs
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
View Full Code Here

        database.getCheckpointer().checkpoint();
       
        // check whether the snapshot contains exactly the specified key-value
        // pairs
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
View Full Code Here

       
        // check whether the snapshot contains exactly the specified key-value
        // pairs
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
View Full Code Here

        // check whether the snapshot contains exactly the specified key-value
        // pairs
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
        it = snap1.prefixLookup(0, null, null).get();
View Full Code Here

        // pairs
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
        it = snap1.prefixLookup(0, null, null).get();
        next = it.next();
View Full Code Here

        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
        it = snap1.prefixLookup(0, null, null).get();
        next = it.next();
        assertEquals("test", new String(next.getKey()));
View Full Code Here

        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "testabc".getBytes(), null).get());
        assertNull(snap1.lookup(0, "yagga".getBytes(), null).get());
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
        assertNull(snap1.lookup(0, "test2".getBytes(), null).get());
       
        it = snap1.prefixLookup(0, null, null).get();
        next = it.next();
        assertEquals("test", new String(next.getKey()));
        assertEquals("v2", new String(next.getValue()));
View Full Code Here

            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
        db = database.getDatabaseManager().getDatabase("test");
        snap1 = database.getSnapshotManager().getSnapshotDB("test", "snap1");
       
        // check whether the snapshot exists and contains the correct value
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
       
        // create a checkpoint and restart the database again
View Full Code Here

        db = database.getDatabaseManager().getDatabase("test");
        snap1 = database.getSnapshotManager().getSnapshotDB("test", "snap1");
       
        // check whether the snapshot exists and contains the correct value
        assertEquals("v1", new String(snap1.lookup(0, "testxyz".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(0, "test".getBytes(), null).get()));
        assertEquals("v1", new String(snap1.lookup(3, "foo".getBytes(), null).get()));
        assertEquals("v2", new String(snap1.lookup(3, "bar".getBytes(), null).get()));
       
        // create a checkpoint and restart the database again
        database.getCheckpointer().checkpoint();
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.