Package org.xtreemfs.babudb.index

Examples of org.xtreemfs.babudb.index.LSMTree.firstEntry()


            map.put(keys[i], vals[i]);
        }
       
        for (byte[] key : map.keySet())
            assertEquals(new String(map.get(key)), new String(tree.lookup(key)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
       
        // create, materialize and link a new snapshot
        int snapId = tree.createSnapshot();
        tree.materializeSnapshot(SNAP_FILE, snapId);
        tree.linkToSnapshot(SNAP_FILE);
View Full Code Here


        tree.materializeSnapshot(SNAP_FILE, snapId);
        tree.linkToSnapshot(SNAP_FILE);
       
        for (byte[] key : map.keySet())
            assertEquals(new String(map.get(key)), new String(tree.lookup(key)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
       
        // insert some more keys-value pairs
        byte[][] newKeys = new byte[][] { "00001".getBytes(), "00006".getBytes(), "00002".getBytes(),
            "00007".getBytes(), "00008".getBytes(), "00009".getBytes(), "00003".getBytes() };
        byte[][] newVals = new byte[][] { null, "gf".getBytes(), "werr".getBytes(), "afds".getBytes(),
View Full Code Here

                map.remove(newKeys[i]);
        }
       
        for (byte[] key : map.keySet())
            assertEquals(new String(map.get(key)), new String(tree.lookup(key)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
       
        // perform a prefix lookup
        Iterator<Entry<byte[], byte[]>> it = tree.prefixLookup(new byte[0]);
        Iterator<Entry<byte[], byte[]>> entries = map.entrySet().iterator();
       
View Full Code Here

        tree.materializeSnapshot(SNAP_FILE2, snapId);
        tree.linkToSnapshot(SNAP_FILE2);
       
        for (byte[] key : map.keySet())
            assertEquals(new String(map.get(key)), new String(tree.lookup(key)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
       
        // delete all entries
        for (byte[] key : keys) {
            map.remove(key);
            tree.delete(key);
View Full Code Here

        while (it.hasNext())
            assertEquals(itExpected.next(), it.next().getValue());
        assertFalse(itExpected.hasNext());
       
        // first entry, current tree
        assertEquals(map3.firstEntry().getKey(), tree.firstEntry().getKey());
        assertEquals(map3.firstEntry().getValue(), tree.firstEntry().getValue());
       
        // last entry, current tree
        assertEquals(map3.lastEntry().getKey(), tree.lastEntry().getKey());
        assertEquals(map3.lastEntry().getValue(), tree.lastEntry().getValue());
View Full Code Here

            assertEquals(itExpected.next(), it.next().getValue());
        assertFalse(itExpected.hasNext());
       
        // first entry, current tree
        assertEquals(map3.firstEntry().getKey(), tree.firstEntry().getKey());
        assertEquals(map3.firstEntry().getValue(), tree.firstEntry().getValue());
       
        // last entry, current tree
        assertEquals(map3.lastEntry().getKey(), tree.lastEntry().getKey());
        assertEquals(map3.lastEntry().getValue(), tree.lastEntry().getValue());
       
View Full Code Here

        // last entry, current tree
        assertEquals(map3.lastEntry().getKey(), tree.lastEntry().getKey());
        assertEquals(map3.lastEntry().getValue(), tree.lastEntry().getValue());
       
        // first entry, snapshot 2
        assertEquals(map2.firstEntry().getKey(), tree.firstEntry(snap2).getKey());
        assertEquals(map2.firstEntry().getValue(), tree.firstEntry(snap2).getValue());
       
        // last entry, snapshot 2
        assertEquals(map2.lastEntry().getKey(), tree.lastEntry(snap2).getKey());
        assertEquals(map2.lastEntry().getValue(), tree.lastEntry(snap2).getValue());
View Full Code Here

        assertEquals(map3.lastEntry().getKey(), tree.lastEntry().getKey());
        assertEquals(map3.lastEntry().getValue(), tree.lastEntry().getValue());
       
        // first entry, snapshot 2
        assertEquals(map2.firstEntry().getKey(), tree.firstEntry(snap2).getKey());
        assertEquals(map2.firstEntry().getValue(), tree.firstEntry(snap2).getValue());
       
        // last entry, snapshot 2
        assertEquals(map2.lastEntry().getKey(), tree.lastEntry(snap2).getKey());
        assertEquals(map2.lastEntry().getValue(), tree.lastEntry(snap2).getValue());
       
View Full Code Here

        // last entry, snapshot 2
        assertEquals(map2.lastEntry().getKey(), tree.lastEntry(snap2).getKey());
        assertEquals(map2.lastEntry().getValue(), tree.lastEntry(snap2).getValue());
       
        // first entry, snapshot 1
        assertEquals(map1.firstEntry().getKey(), tree.firstEntry(snap1).getKey());
        assertEquals(map1.firstEntry().getValue(), tree.firstEntry(snap1).getValue());
       
        // last entry, snapshot 1
        assertEquals(map1.lastEntry().getKey(), tree.lastEntry(snap1).getKey());
        assertEquals(map1.lastEntry().getValue(), tree.lastEntry(snap1).getValue());
View Full Code Here

        assertEquals(map2.lastEntry().getKey(), tree.lastEntry(snap2).getKey());
        assertEquals(map2.lastEntry().getValue(), tree.lastEntry(snap2).getValue());
       
        // first entry, snapshot 1
        assertEquals(map1.firstEntry().getKey(), tree.firstEntry(snap1).getKey());
        assertEquals(map1.firstEntry().getValue(), tree.firstEntry(snap1).getValue());
       
        // last entry, snapshot 1
        assertEquals(map1.lastEntry().getKey(), tree.lastEntry(snap1).getKey());
        assertEquals(map1.lastEntry().getValue(), tree.lastEntry(snap1).getValue());
       
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.