Examples of singleInsert()


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

            myDb = babuDB0.getDatabaseManager().createDatabase("myDatabase", 1);
        }
       
        System.out.println("Inserting \"testValue\" for \"testKey\" into \"myDatabase\" ... ");
       
        myDb.singleInsert(0, "testKey".getBytes(), "testValue".getBytes(), null).get();
       
        System.out.println("Retrieving the test values from both BabuDB instance ... ");
       
        byte[] result1 = babuDB1.getDatabaseManager().getDatabase("myDatabase")
                .lookup(0, "testKey".getBytes(), null).get();
View Full Code Here

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

                        if (next == null) {
                            throw new BabuDBException(ErrorCode.INTERNAL_ERROR,
                                "database conversion failed, dump corrupted");
                        }
                       
                        db.singleInsert(indexId, next.getKey(), next.getValue(), null).get();
                    }
                   
                    it.destroy();
                }
               
View Full Code Here

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

        for (int i = 0; i < numIndices; i++) {
            for (int e = 0; e < 100; e++) {
                int randnum = (int) (Math.random() * Integer.MAX_VALUE);
                final String key = String.valueOf(randnum);
                final String value = "VALUE_" + randnum;
                db.singleInsert(i, key.getBytes(), value.getBytes(),null).get();
            }
        }
       
        System.out.println("Creating backup database...");
        database.getDatabaseManager().dumpAllDatabases(backupDir);
View Full Code Here

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

        for (int i = 0; i < numIndices; i++) {
            for (int e = 0; e < 100; e++) {
                int randnum = (int) (Math.random() * Integer.MAX_VALUE);
                final String key = String.valueOf(randnum);
                final String value = "VALUE_" + randnum;
                backupDB.singleInsert(i, key.getBytes(), value.getBytes(),null).get();
            }
        }

        System.out.println("shutting down databases...");
        database.shutdown();
View Full Code Here

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

        for (int i = 0; i < NUMIDX; i++) {
            for (int e = 0; e < 100; e++) {
                int randnum = (int) (Math.random() * Integer.MAX_VALUE);
                final String key = String.valueOf(randnum);
                final String value = "VALUE_" + randnum;
                db.singleInsert(i, key.getBytes(), value.getBytes(),null).get();
            }
        }
       
        System.out.println("starting copy");
        // copy database
View Full Code Here

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

            if (i == 10) {
                cpThread.start();
                Thread.sleep(2);
            }
           
            db.singleInsert(0, keyBuf.array(), valBuf.array(), null).get();
        }
       
        ByteBuffer keyBuf = ByteBuffer.wrap(new byte[8]);
        ByteBuffer valBuf = ByteBuffer.wrap(new byte[32]);
        for (long i = 0; i < entryCount; i++) {
View Full Code Here

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

    @Test
    public void testReplayAfterCrash() throws Exception {
        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");
       
View Full Code Here

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

        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();
        value = new String(result);
        assertEquals(value, "Blupp");
       
        db.singleInsert(0, "Blupp".getBytes(), "Blahh".getBytes(), null).get();
View Full Code Here

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

        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();
        value = new String(result);
        assertEquals(value, "Blahh");
       
        ((BabuDBImpl) database).__test_killDB_dangerous();
View Full Code Here

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

    @Test
    public void testShutdownAfterCheckpoint() throws Exception {
        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();
       
        byte[] result = db.lookup(0, "Yagga".getBytes(), null).get();
        String value = new String(result);
        assertEquals(value, "Brabbel");
       
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.