Package org.xtreemfs.babudb.api.database

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


        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();
        database.shutdown();
View Full Code Here


       
        // 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();
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
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()));
       
        ir = db.createInsertGroup();
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()));
       
        ir = db.createInsertGroup();
        ir.addInsert(0, "te".getBytes(), "x".getBytes());
View Full Code Here

        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()));
       
        ir = db.createInsertGroup();
        ir.addInsert(0, "te".getBytes(), "x".getBytes());
        ir.addInsert(0, "key".getBytes(), "x".getBytes());
View Full Code Here

       
        // 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()));
       
        ir = db.createInsertGroup();
        ir.addInsert(0, "te".getBytes(), "x".getBytes());
        ir.addInsert(0, "key".getBytes(), "x".getBytes());
        db.insert(ir, null).get();
View Full Code Here

            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
       
        DatabaseRO snap2 = database.getSnapshotManager().getSnapshotDB("test", "snap2");
       
        // check whether only the records covered by the prefixes are contained
        assertEquals("x", new String(snap2.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap2.lookup(0, "testxyz".getBytes(), null).get());
        assertNull(snap2.lookup(0, "te".getBytes(), null).get());
        assertNull(snap2.lookup(0, "key".getBytes(), null).get());
       
    }
View Full Code Here

       
        DatabaseRO snap2 = database.getSnapshotManager().getSnapshotDB("test", "snap2");
       
        // check whether only the records covered by the prefixes are contained
        assertEquals("x", new String(snap2.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap2.lookup(0, "testxyz".getBytes(), null).get());
        assertNull(snap2.lookup(0, "te".getBytes(), null).get());
        assertNull(snap2.lookup(0, "key".getBytes(), null).get());
       
    }
   
View Full Code Here

        DatabaseRO snap2 = database.getSnapshotManager().getSnapshotDB("test", "snap2");
       
        // check whether only the records covered by the prefixes are contained
        assertEquals("x", new String(snap2.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap2.lookup(0, "testxyz".getBytes(), null).get());
        assertNull(snap2.lookup(0, "te".getBytes(), null).get());
        assertNull(snap2.lookup(0, "key".getBytes(), null).get());
       
    }
   
    public void testDelete() throws Exception {
View Full Code Here

       
        // check whether only the records covered by the prefixes are contained
        assertEquals("x", new String(snap2.lookup(0, "test".getBytes(), null).get()));
        assertNull(snap2.lookup(0, "testxyz".getBytes(), null).get());
        assertNull(snap2.lookup(0, "te".getBytes(), null).get());
        assertNull(snap2.lookup(0, "key".getBytes(), null).get());
       
    }
   
    public void testDelete() throws Exception {
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
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.