Package org.xtreemfs.babudb.api.database

Examples of org.xtreemfs.babudb.api.database.Database


        database.getDatabaseManager().createDatabase(dbname, 5);
    }
   
    public void startTest() throws Exception {
       
        final Database db = database.getDatabaseManager().getDatabase(dbname);
        long dbSize = 0;
        boolean[] contents = new boolean[10000];
       
        for (;;) {
           
            final int numInGroup = (int) Math.round(Math.random() * 9) + 1;
            final DatabaseInsertGroup ig = db.createInsertGroup();
            for (int i = 0; i < numInGroup; i++) {
                final byte[] key = generateData(30);
                final byte[] value = generateData(10000);
                ig.addInsert((int) (Math.random() * 5), key, value);
                dbSize += key.length + value.length;
            }
           
            db.insert(ig, null).get();
           
            int block = (int) (dbSize / (1024 * 1204 * 50));
            if (block > 0 && !contents[block]) {
                contents[block] = true;
                System.out.println(dbSize / (1024 * 1204) + " MB");
View Full Code Here

TOP

Related Classes of org.xtreemfs.babudb.api.database.Database

Copyright © 2018 www.massapicom. 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.