Package org.xtreemfs.babudb.api.database

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


    public void performUserDefinedLookups() throws BabuDBException, InterruptedException {
        long tStart = System.currentTimeMillis();
        int hits = 0;
        for (int i = 0; i < numKeys; i++) {
            final byte[] key = createRandomKey();
            byte[] value = (byte[]) database.getDatabaseManager().getDatabase(dbName).userDefinedLookup(new UserDefinedLookup() {

                public Object execute(LSMLookupInterface database) throws BabuDBException {
                    byte[] result = null;
                    for (int i = 0; i < 20; i++)
                        result = database.lookup(0, key);
View Full Code Here


            System.exit(1);
        }
    }
   
    private void doUserLookup(final LSMDBRequest<Object> r) {
        final UserDefinedLookup l = r.getUserDefinedLookup();
        final LSMLookupInterface lif = new LSMLookupInterface(r.getDatabase());
        try {
            Object result = l.execute(lif);
            r.getListener().finished(result);
        } catch (BabuDBException ex) {
            r.getListener().failed(ex);
        }
    }
View Full Code Here

        ir.addInsert(0, "Key1".getBytes(), "Value1".getBytes());
        ir.addInsert(1, "Key2".getBytes(), "Value2".getBytes());
        ir.addInsert(2, "Key3".getBytes(), "Value3".getBytes());
        db.insert(ir, null).get();
       
        UserDefinedLookup lookup = new UserDefinedLookup() {
           
            public Object execute(LSMLookupInterface database) throws BabuDBException {
                if ((database.lookup(0, "Key1".getBytes()) != null)
                    && (database.lookup(1, "Key2".getBytes()) != null)) {
                    return new Boolean(true);
View Full Code Here

TOP

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

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.