Package org.xtreemfs.babudb.index

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


   
    public byte[] lookup(int indexId, byte[] key) throws BabuDBException {
        LSMTree tree = database.getIndex(indexId);
        if (tree == null)
            throw new BabuDBException(BabuDBException.ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
        return tree.lookup(key);
    }
   
    public byte[] lookup(int indexId, byte[] key, int snapId) throws BabuDBException {
        LSMTree tree = database.getIndex(indexId);
        if (tree == null)
View Full Code Here


   
    public byte[] lookup(int indexId, byte[] key, int snapId) throws BabuDBException {
        LSMTree tree = database.getIndex(indexId);
        if (tree == null)
            throw new BabuDBException(BabuDBException.ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
        return tree.lookup(key,snapId);
    }
   
    public Iterator<Entry<byte[],byte[]>> prefixLookup(int indexId, byte[] startKey) throws BabuDBException {
        LSMTree tree = database.getIndex(indexId);
        if (tree == null)
View Full Code Here

        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()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
View Full Code Here

        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()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
View Full Code Here

            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()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
View Full Code Here

        tree.linkToSnapshot(SNAP_FILE);
       
        assertEquals(value, tree.lookup("a".getBytes()));
        assertEquals(null, tree.lookup("v".getBytes()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
       
View Full Code Here

       
        assertEquals(value, tree.lookup("a".getBytes()));
        assertEquals(null, tree.lookup("v".getBytes()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
       
        Iterator<Entry<byte[], byte[]>> it = tree.prefixLookup(new byte[0]);
View Full Code Here

        assertEquals(value, tree.lookup("a".getBytes()));
        assertEquals(null, tree.lookup("v".getBytes()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
       
        Iterator<Entry<byte[], byte[]>> it = tree.prefixLookup(new byte[0]);
        int i = 0;
View Full Code Here

        assertEquals(null, tree.lookup("v".getBytes()));
        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
       
        Iterator<Entry<byte[], byte[]>> it = tree.prefixLookup(new byte[0]);
        int i = 0;
        for (; it.hasNext(); i++)
View Full Code Here

        assertEquals(value, tree.lookup("blub".getBytes()));
        assertEquals(value, tree.lookup("blubber".getBytes()));
        assertEquals(null, tree.lookup("ertz".getBytes()));
        assertEquals(null, tree.lookup("yaggaa".getBytes()));
        assertEquals(value, tree.lookup("zwum".getBytes()));
        assertEquals(null, tree.lookup("x".getBytes()));
       
        Iterator<Entry<byte[], byte[]>> it = tree.prefixLookup(new byte[0]);
        int i = 0;
        for (; it.hasNext(); i++)
            it.next();
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.