Package org.xtreemfs.babudb.api.exception

Examples of org.xtreemfs.babudb.api.exception.BabuDBException


                                f.getAbsolutePath());
                    }
                }
            }
        } catch (IOException ex) {
            throw new BabuDBException(ErrorCode.IO_ERROR, "cannot create checkpoint", ex);
        }
        Logging.logMessage(Logging.LEVEL_INFO, this, "checkpoint complete");
    }
View Full Code Here


    @Override
    public byte[] directLookup(int indexId, byte[] key) throws BabuDBException {
       
        Integer snapId = snapIDMap.get(indexId);
        if (snapId == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        return (isCovered(indexId, key) && snap.containsKey(indexId, key)) ?
                db.directLookup(indexId, snapId, key) : null;
    }
View Full Code Here

    public ResultSet<byte[], byte[]> directPrefixLookup(final int indexId, final byte[] key,
        final boolean ascending) throws BabuDBException {
       
        final Integer snapId = snapIDMap.get(indexId);
        if (snapId == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        return new ResultSet<byte[], byte[]>() {
           
            private ResultSet<byte[], byte[]> it;
           
View Full Code Here

    public ResultSet<byte[], byte[]> directRangeLookup(final int indexId, final byte[] from,
        final byte[] to, final boolean ascending) throws BabuDBException {
       
        final Integer snapId = snapIDMap.get(indexId);
        if (snapId == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        return new ResultSet<byte[], byte[]>() {
           
            private ResultSet<byte[], byte[]> it;
           
View Full Code Here

                int index = Integer.parseInt(file.substring(file.indexOf("IX") + 2, file.indexOf('V')));
                indexMap.put(index, new DiskIndex(dir + "/" + file, comps[index], compressed, mmaped));
            }
           
        } catch (IOException exc) {
            throw new BabuDBException(ErrorCode.IO_ERROR, "could not load index file", exc);
        }
    }
View Full Code Here

    @Override
    public byte[] directLookup(int indexId, byte[] key) throws BabuDBException {
       
        DiskIndex index = indexMap.get(indexId);
        if (index == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        return index.lookup(key);
    }
View Full Code Here

    @Override
    public ResultSet<byte[], byte[]> directPrefixLookup(int indexId, byte[] key, boolean ascending) throws BabuDBException {
       
        DiskIndex index = indexMap.get(indexId);
        if (index == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        byte[][] range = index.getComparator().prefixToRange(key, true);
        return index.rangeLookup(range[0], range[1], ascending);
    }
View Full Code Here

    @Override
    public ResultSet<byte[], byte[]> directRangeLookup(int indexId, byte[] from, byte[] to, boolean ascending) throws BabuDBException {
       
        DiskIndex index = indexMap.get(indexId);
        if (index == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX, "index " + indexId + " does not exist");
       
        return index.rangeLookup(from, to, ascending);
    }
View Full Code Here

        try {
            for (DiskIndex index : indexMap.values()) {
                index.destroy();
            }
        } catch (IOException exc) {
            throw new BabuDBException(ErrorCode.IO_ERROR, "", exc);
        }
    }
View Full Code Here

    @Override
    public DatabaseRO getSnapshotDB(String dbName, String snapshotName) throws BabuDBException {
       
        Map<String, Snapshot> snapMap = snapshotDBs.get(dbName);
        if (snapMap == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_SNAPSHOT, "no snapshots exist for database '"
                + dbName + "'");
       
        Snapshot snap = snapMap.get(snapshotName);
        if (snap == null)
            throw new BabuDBException(ErrorCode.NO_SUCH_SNAPSHOT, "no snapshot '" + snapshotName
                + "' exists for database '" + dbName + "'");
       
        return snap;
    }
View Full Code Here

TOP

Related Classes of org.xtreemfs.babudb.api.exception.BabuDBException

Copyright © 2018 www.massapicom. 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.