Examples of materializeSnapshot()


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

           
            // clean up incomplete old checkpoints if necessary
            if (tmpDir.exists())
                FSUtils.delTree(tmpDir);
           
            tree.materializeSnapshot(tmpDir.getAbsolutePath(), snapIds[index]);
           
            if (!tmpDir.renameTo(targetDir))
                throw new IOException("could not rename '" + tmpDir + "' to " + targetDir);
           
            if (Logging.isInfo())
View Full Code Here

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

        throws IOException {
       
        for (int index = 0; index < trees.size(); index++) {
            final LSMTree tree = trees.get(index);
            final String newFileName = directory + "/" + getSnapshotFilename(index, viewId, sequenceNumber);
            tree.materializeSnapshot(newFileName, snapIds[index]);
        }
    }
   
    public void writeSnapshot(String directory, int[] snapIds, SnapshotConfig cfg) throws IOException {
       
View Full Code Here

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

           
            File dir = new File(directory);
            if (!dir.exists() && !dir.mkdirs())
                throw new IOException("Directory doesnt exist and cannot be created:'" + directory + "'");
           
            tree.materializeSnapshot(newFileName, snapIds[i], index, cfg);
        }
    }
   
    /**
     * Links the indices to the latest on-disk snapshot, cleans up any
View Full Code Here

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

        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()));
        assertEquals(null, tree.lookup("v".getBytes()));
View Full Code Here

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

            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)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
View Full Code Here

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

       
        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)));
        assertEquals(new String(map.firstKey()), new String(tree.firstEntry().getKey()));
View Full Code Here

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

        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

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

       
        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()));
       
        tree.destroy();
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.