Examples of BabuDBConfig


Examples of org.xtreemfs.babudb.config.BabuDBConfig

            database.shutdown();
    }
   
    public void testSimpleSnapshot() throws Exception {
       
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
        Database db = database.getDatabaseManager().createDatabase("test", 3);
       
        // add some key-value pairs
        DatabaseInsertGroup ir = db.createInsertGroup();
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

       
    }
   
    public void testPartialSnapshot() throws Exception {
       
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
        Database db = database.getDatabaseManager().createDatabase("test", 4);
       
        // add some key-value pairs
        DatabaseInsertGroup ir = db.createInsertGroup();
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

        assertFalse(it.hasNext());
       
    }
   
    public void testShutdownRestart() throws Exception {
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
        Database db = database.getDatabaseManager().createDatabase("test", 4);
       
        // add some key-value pairs
        DatabaseInsertGroup ir = db.createInsertGroup();
        ir.addInsert(0, "testxyz".getBytes(), "v1".getBytes());
        ir.addInsert(0, "test".getBytes(), "v2".getBytes());
        ir.addInsert(0, "yagga".getBytes(), "bla".getBytes());
        ir.addInsert(3, "foo".getBytes(), "v1".getBytes());
        ir.addInsert(3, "bar".getBytes(), "v2".getBytes());
        db.insert(ir, null).get();
       
        // create a snapshot (in memory)
        database.getSnapshotManager().createPersistentSnapshot("test",
            new DefaultSnapshotConfig("snap1", new int[] { 0, 3 }, null, null));
        DatabaseRO snap1 = database.getSnapshotManager().getSnapshotDB("test", "snap1");
       
        // overwrite original values
        ir = db.createInsertGroup();
        ir.addInsert(0, "testxyz".getBytes(), "x".getBytes());
        ir.addInsert(0, "test".getBytes(), "x".getBytes());
        ir.addInsert(3, "foo".getBytes(), "x".getBytes());
        ir.addInsert(3, "bar".getBytes(), "x".getBytes());
        db.insert(ir, null).get();
       
        // restart the database
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            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
        database.getCheckpointer().checkpoint();
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            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();
        ir.addInsert(0, "te".getBytes(), "x".getBytes());
        ir.addInsert(0, "key".getBytes(), "x".getBytes());
        db.insert(ir, null).get();
       
        // create a partial user-defined snapshot
        database.getSnapshotManager().createPersistentSnapshot("test", new TestSnapshotConfig());
       
        // checkpoint and restart the database
        database.getCheckpointer().checkpoint();
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            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
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

        assertNull(snap2.lookup(0, "key".getBytes(), null).get());
       
    }
   
    public void testDelete() throws Exception {
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
        Database db = database.getDatabaseManager().createDatabase("test", 4);
       
        // add some key-value pairs
        DatabaseInsertGroup ir = db.createInsertGroup();
        ir.addInsert(0, "testxyz".getBytes(), "v1".getBytes());
        ir.addInsert(0, "test".getBytes(), "v2".getBytes());
        ir.addInsert(0, "yagga".getBytes(), "bla".getBytes());
        ir.addInsert(1, "foo".getBytes(), "v1".getBytes());
        ir.addInsert(1, "bar".getBytes(), "v2".getBytes());
        db.insert(ir, null).get();
       
        // create a snapshot
        database.getSnapshotManager().createPersistentSnapshot("test",
            new DefaultSnapshotConfig("snap1", new int[] { 0, 3 }, null, null));
       
        // delete the snapshot
        database.getSnapshotManager().deletePersistentSnapshot("test", "snap1");
        try {
            database.getSnapshotManager().getSnapshotDB("test", "snap1");
            fail();
        } catch (Exception exc) {
            // ok
        }
       
        ir = db.createInsertGroup();
        ir.addInsert(0, "testxyz".getBytes(), "ggg".getBytes());
        ir.addInsert(0, "test".getBytes(), "ggg".getBytes());
        db.insert(ir, null).get();
       
        // restart the database w/o checkpointing
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
       
        // checkpoint and restart the database
        database.getCheckpointer().checkpoint();
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0,
            SyncMode.SYNC_WRITE, 0, 0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, DEBUG_LEVEL));
       
        // check if the formerly deleted snapshot does not exist anymore
        try {
            database.getSnapshotManager().getSnapshotDB("test", "snap1");
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

        final int maxValSize = 16384;
       
        // FSUtils.delTree(new File(dbDir));
       
        // start the database
        final BabuDB databaseSystem = BabuDBFactory.createBabuDB(new BabuDBConfig(dbDir, dbDir, numThreads,
                maxLogFileSize, 10, SyncMode.ASYNC, 1000, 0, false, 16, 1024 * 1024 * 256));
        DatabaseManager dbm = databaseSystem.getDatabaseManager();
       
        // for (int i = 0; i < numDBs; i++)
        // dbm.createDatabase("DB" + i, numIndices);
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

        bfr.close();
        fr.close();
        this.numIndices = numIndices;
       
        // checkpoint every 1m and check every 1 min
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(basedir, basedir, 2, 1024 * 128, 20 * 1,
            SyncMode.ASYNC, 0, 0, compression, 16, 1024 * 1024 * 512));
       
        //database.getDatabaseManager().createDatabase(dbname, numIndices);
       
//        controlIndices = new TreeMap[numIndices];
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

    private BabuDB             database;
   
    public HugeDBTest(String basedir) throws IOException, BabuDBException {
       
        // checkpoint every 1m and check every 1 min
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(basedir, basedir, 0, 1024 * 128, 60 * 1,
            SyncMode.ASYNC, 0, 0, false, 16, 1024 * 1024 * 512));
       
        database.getDatabaseManager().createDatabase(dbname, 5);
    }
View Full Code Here

Examples of org.xtreemfs.babudb.config.BabuDBConfig

    private DatabaseManager databaseManager = null;
    private Database geoTiles = null;

    public DatabaseInterface(String dbPath) throws IOException {
        final int numThreads = 0;
        BabuDBConfig babuDBConfig = new BabuDBConfig(dbPath + "/databases/", dbPath + "/dblog/", numThreads, 1024*1024*16, 5*60, SyncMode.FSYNC, 50, 0, false, 16, 1024*1024*512);

        try {
            babuDB = BabuDBFactory.createBabuDB(babuDBConfig);
            databaseManager = babuDB.getDatabaseManager();
        }
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.