Package org.xtreemfs.babudb.index

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


     */
    public int[] createSnapshot() {
        int[] snapIds = new int[trees.size()];
        for (int index = 0; index < trees.size(); index++) {
            final LSMTree tree = trees.get(index);
            snapIds[index] = tree.createSnapshot();
        }
        return snapIds;
    }
   
    /**
 
View Full Code Here


     */
    public int[] createSnapshot(int[] indices) {
        int[] snapIds = new int[indices.length];
        for (int index = 0; index < indices.length; index++) {
            final LSMTree tree = trees.get(indices[index]);
            snapIds[index] = tree.createSnapshot();
        }
        return snapIds;
    }
   
    /**
 
View Full Code Here

            tree.insert(key, null);
            map2.remove(key);
        }
       
        // take a snapshot
        int snap2 = tree.createSnapshot();
        final TreeMap<byte[], byte[]> map3 = new TreeMap<byte[], byte[]>(map2);
       
        // overwrite every 5th key
        for (int i = 0x10; i < numElements; i += 5) {
            byte[] key = Integer.toHexString(i).getBytes();
View Full Code Here

       
        LSMTree tree = new LSMTree(null, comp, COMPRESSION, 16, 1024 * 1024 * 512, MMAP, -1);
        for (String k : keys)
            tree.insert(k.getBytes(), value);
       
        int snapId = tree.createSnapshot();
        tree.materializeSnapshot(SNAP_FILE, snapId, 0, new DefaultSnapshotConfig("blub", new int[] { 0 },
            new byte[][][] { { "a".getBytes(), "bl".getBytes(), "zwum".getBytes() } }, null));
        tree.linkToSnapshot(SNAP_FILE);
       
        assertEquals(value, tree.lookup("a".getBytes()));
View Full Code Here

        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);
       
        for (byte[] key : map.keySet())
            assertEquals(new String(map.get(key)), new String(tree.lookup(key)));
View Full Code Here

        }
       
        assertEquals(map.size(), count);
       
        // create, materialize and link a new snapshot
        snapId = tree.createSnapshot();
        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)));
View Full Code Here

       
        assertEquals(0, map.size());
        assertFalse(tree.prefixLookup(new byte[0]).hasNext());
       
        // create, materialize and link a new snapshot
        snapId = tree.createSnapshot();
        tree.materializeSnapshot(SNAP_FILE3, snapId);
        tree.linkToSnapshot(SNAP_FILE3);
       
        it = tree.prefixLookup(new byte[0]);
        assertFalse(it.hasNext());
View Full Code Here

        assertFalse(it.hasNext());
       
        tree.insert("test".getBytes(), "test".getBytes());
        tree.delete("test".getBytes());
       
        snapId = tree.createSnapshot();
        tree.materializeSnapshot(SNAP_FILE4, snapId);
        tree.linkToSnapshot(SNAP_FILE4);
       
        assertEquals(null, tree.lookup("test".getBytes()));
       
View Full Code Here

            byte[] val = Integer.toHexString((int) (Math.random() * Integer.MAX_VALUE)).getBytes();
            map1.put(key, val);
            tree.insert(key, val);
        }
       
        int snap1 = tree.createSnapshot();
        final TreeMap<byte[], byte[]> map2 = new TreeMap<byte[], byte[]>(map1);
       
        for (int i = 0x10; i < numElements; i += 2) {
            byte[] key = Integer.toHexString(i).getBytes();
            tree.insert(key, null);
View Full Code Here

            byte[] key = Integer.toHexString(i).getBytes();
            tree.insert(key, null);
            map2.remove(key);
        }
       
        int snap2 = tree.createSnapshot();
        final TreeMap<byte[], byte[]> map3 = new TreeMap<byte[], byte[]>(map2);
       
        for (int i = 0x10; i < numElements; i += 5) {
            byte[] key = Integer.toHexString(i).getBytes();
            byte[] val = Integer.toHexString((int) (Math.random() * Integer.MAX_VALUE)).getBytes();
 
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.