Package org.xtreemfs.babudb.api.database

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


           
            // and execute group insert
            db.insert(group, null).get();
           
            // now do a lookup
            byte[] result = db.lookup(0, "Key1".getBytes(), null).get();
           
            // create a checkpoint for faster start-ups
            databaseSystem.getCheckpointer().checkpoint();
           
            // shutdown database
View Full Code Here


        res = test1.lookup(0, "bla10".getBytes(), test0).get();
        assertNotNull(res);
        assertEquals("blub10", new String(res));
        assertNull(test0.lookup(0, "bla20".getBytes(), test0).get());
       
        res = test2.lookup(0, "bla20".getBytes(), test0).get();
        assertNotNull(res);
        assertEquals("blub20", new String(res));
        assertNull(test0.lookup(0, "bla01".getBytes(), test0).get());
    }
   
View Full Code Here

        assertNotNull(res);
        assertEquals("blub10", new String(res));
       
        assertNull(test1.lookup(0, "bla20".getBytes(), test1).get());
       
        res = test2.lookup(0, "bla20".getBytes(), test2).get();
        assertNotNull(res);
        assertEquals("blub20", new String(res));
       
        assertNull(test2.lookup(0, "bla10".getBytes(), test2).get());
    }
View Full Code Here

       
        res = test2.lookup(0, "bla20".getBytes(), test2).get();
        assertNotNull(res);
        assertEquals("blub20", new String(res));
       
        assertNull(test2.lookup(0, "bla10".getBytes(), test2).get());
    }
}
View Full Code Here

            System.out.println("checking index " + i);
            Iterator<Entry<byte[], byte[]>> values = db.prefixLookup(i, "1".getBytes(),null).get();
           
            while (values.hasNext()) {
                Entry<byte[], byte[]> e = values.next();
                byte[] v = backupDB.lookup(i, e.getKey(),null).get();
                assertNotNull(v);
                assertEquals(v.length, e.getValue().length);
                for (int p = 0; p < v.length; p++)
                    assertEquals(v[p], e.getValue()[p]);
            }
View Full Code Here

           
            keyBuf.putLong(0, i);
            valBuf.putLong(0, i);
            valBuf.putLong(24, i);
           
            byte[] val = db.lookup(0, keyBuf.array(), null).get();
            assertEquals(valBuf.array(), val);
        }
       
        Iterator<Entry<byte[], byte[]>> it = db.prefixLookup(0, new byte[0], null).get();
        for (long i = 0; i < entryCount; i++) {
View Full Code Here

        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, LOG_LEVEL));
        Database db = database.getDatabaseManager().createDatabase("test", 2);
        db.singleInsert(0, "Yagga".getBytes(), "Brabbel".getBytes(), null).get();
        database.getCheckpointer().checkpoint();
        byte[] result = db.lookup(0, "Yagga".getBytes(), null).get();
        String value = new String(result);
        assertEquals(value, "Brabbel");
       
        db.singleInsert(0, "Brabbel".getBytes(), "Blupp".getBytes(), null).get();
        result = db.lookup(0, "Brabbel".getBytes(), null).get();
View Full Code Here

        byte[] result = db.lookup(0, "Yagga".getBytes(), null).get();
        String value = new String(result);
        assertEquals(value, "Brabbel");
       
        db.singleInsert(0, "Brabbel".getBytes(), "Blupp".getBytes(), null).get();
        result = db.lookup(0, "Brabbel".getBytes(), null).get();
        value = new String(result);
        assertEquals(value, "Blupp");
       
        db.singleInsert(0, "Blupp".getBytes(), "Blahh".getBytes(), null).get();
        result = db.lookup(0, "Blupp".getBytes(), null).get();
View Full Code Here

        result = db.lookup(0, "Brabbel".getBytes(), null).get();
        value = new String(result);
        assertEquals(value, "Blupp");
       
        db.singleInsert(0, "Blupp".getBytes(), "Blahh".getBytes(), null).get();
        result = db.lookup(0, "Blupp".getBytes(), null).get();
        value = new String(result);
        assertEquals(value, "Blahh");
       
        ((BabuDBImpl) database).__test_killDB_dangerous();
        Thread.sleep(500);
View Full Code Here

        Thread.sleep(500);
       
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 2, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, LOG_LEVEL));
        db = database.getDatabaseManager().getDatabase("test");
        result = db.lookup(0, "Yagga".getBytes(), null).get();
        assertNotNull(result);
        value = new String(result);
        assertEquals(value, "Brabbel");
       
        result = db.lookup(0, "Brabbel".getBytes(), null).get();
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.