Examples of prefixLookup()


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

        assertEquals("bla2", new String(next.getKey()));
        assertEquals("blub2", new String(next.getValue()));
        assertFalse(result.hasNext());
       
        // perform a prefix lookup on database 'test2'
        result = test2.prefixLookup(0, "bla".getBytes(), null).get();
        assertTrue(result.hasNext());
        next = result.next();
        assertEquals("bla0", new String(next.getKey()));
        assertEquals("blub0", new String(next.getValue()));
        assertTrue(result.hasNext());
View Full Code Here

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

            int numIndices = db.getComparators().length;
            for (int i = 0; i < numIndices; i++) {
               
                out.println("\t\t<index number=\"" + i + "\">");
               
                Iterator<Entry<byte[], byte[]>> it = db.prefixLookup(i, new byte[0], null).get();
                while (it.hasNext()) {
                    Entry<byte[], byte[]> next = it.next();
                    out.println("\t\t\t<key>");
                    out.println("\t\t\t\t" + formatter.formatKey(next.getKey(), db.getName(), i));
                    out.println("\t\t\t</key>");
View Full Code Here

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

       
        System.out.println("copy complete");
        // check entries
        for (int i = 0; i < NUMIDX; i++) {
            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 = database.getDatabaseManager().getDatabase("copyDB").lookup(i, e.getKey(),null).get();
                assertNotNull(v);
View Full Code Here

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

           
            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++) {
           
            Entry<byte[], byte[]> next = it.next();
           
            byte[] key = next.getKey();
View Full Code Here

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

        assertEquals("Value2", new String(result));
       
        result = db.lookup(2, "Key3".getBytes(), null).get();
        assertEquals("Value3", new String(result));
       
        Iterator<Entry<byte[], byte[]>> iter = db.prefixLookup(3, "Key3".getBytes(), null).get();
        assertFalse(iter.hasNext());
       
        ir = db.createInsertGroup();
        ir.addDelete(0, "Key1".getBytes());
        ir.addInsert(1, "Key2".getBytes(), "Value2.2".getBytes());
View Full Code Here

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

        ir.addInsert(1, "Key2".getBytes(), "Value2.2".getBytes());
        ir.addInsert(2, "Key3".getBytes(), "Value2.3".getBytes());
        db.insert(ir, null).get();
        database.getCheckpointer().checkpoint();
       
        iter = db.prefixLookup(2, "Key3".getBytes(), null).get();
        assertTrue(iter.hasNext());
        Entry<byte[], byte[]> next = iter.next();
        assertEquals("Key3", new String(next.getKey()));
        assertEquals("Value2.3", new String(next.getValue()));
        assertTrue(!iter.hasNext());
View Full Code Here

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

            ir.addInsert(1, (i + "").getBytes(), (i + "").getBytes());
            ir.addInsert(2, (i + "").getBytes(), (i + "").getBytes());
            db.insert(ir, null);
        }
       
        Iterator<Entry<byte[], byte[]>> it = db.prefixLookup(0, new byte[0], null).get();
        for (int i = 1000; i < 2000; i++)
            assertEquals(i + "", new String(it.next().getValue()));
        assertFalse(it.hasNext());
       
        it = db.prefixLookup(0, "15".getBytes(), null).get();
View Full Code Here

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

        Iterator<Entry<byte[], byte[]>> it = db.prefixLookup(0, new byte[0], null).get();
        for (int i = 1000; i < 2000; i++)
            assertEquals(i + "", new String(it.next().getValue()));
        assertFalse(it.hasNext());
       
        it = db.prefixLookup(0, "15".getBytes(), null).get();
        for (int i = 1500; i < 1600; i++)
            assertEquals(i + "", new String(it.next().getValue()));
        assertFalse(it.hasNext());
       
        database.getCheckpointer().checkpoint();
View Full Code Here

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

            assertEquals(i + "", new String(it.next().getValue()));
        assertFalse(it.hasNext());
       
        database.getCheckpointer().checkpoint();
       
        it = db.prefixLookup(0, "15".getBytes(), null).get();
        for (int i = 1500; i < 1600; i++)
            assertEquals(i + "", new String(it.next().getValue()));
        assertFalse(it.hasNext());
       
        database.shutdown();
View Full Code Here

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

       
        Database db = dbMan.getDatabase(dbName);
       
        for (int j = 0; j < numIndices; j++) {
           
            ResultSet<byte[], byte[]> resultSet = db.prefixLookup(j, new byte[0], null).get();
            for (int i = j; i < numKVPairs; i += numIndices) {
               
                assertTrue(resultSet.hasNext());
                String kv = intToString(i, ("" + numKVPairs).length());
               
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.