Examples of BabuDBException


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

           
            try {
                w.addRequest(new LSMDBRequest<byte[]>(lsmDB, indexId, result,
                        key));
            } catch (InterruptedException ex) {
                result.failed(new BabuDBException(ErrorCode.INTERRUPTED,
                        "operation was interrupted", ex));
            }
        } else
            directLookup(indexId, key, result);
       
View Full Code Here

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

     */
    private void directLookup(int indexId, byte[] key,
            BabuDBRequestResultImpl<byte[]> listener) {
       
        if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0)) {
            listener.failed(new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                    "index does not exist"));
        } else
            listener.finished(lsmDB.getIndex(indexId).lookup(key));
    }
View Full Code Here

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

           
            try {
                w.addRequest(new LSMDBRequest<ResultSet<byte[], byte[]>>(
                        lsmDB, indexId, result, key, ascending));
            } catch (InterruptedException ex) {
                result.failed(new BabuDBException(ErrorCode.INTERRUPTED,
                        "operation was interrupted", ex));
            }
        }

        // otherwise, perform a direct prefix lookup
        else {
           
            if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0))
                result.failed(new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                        "index does not exist"));
            else
                result.finished(lsmDB.getIndex(indexId).prefixLookup(key,
                        ascending));
        }
View Full Code Here

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

           
            try {
                w.addRequest(new LSMDBRequest<ResultSet<byte[], byte[]>>(
                        lsmDB, indexId, result, from, to, ascending));
            } catch (InterruptedException ex) {
                result.failed(new BabuDBException(ErrorCode.INTERRUPTED,
                        "operation was interrupted", ex));
            }
        }

        // otherwise, perform a direct range lookup
        else {
           
            if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0))
                result.failed(new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                        "index does not exist"));
            else
                result.finished(lsmDB.getIndex(indexId).rangeLookup(from, to,
                        ascending));
        }
View Full Code Here

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

            }
           
            try {
                w.addRequest(new LSMDBRequest<Object>(lsmDB, result, udl));
            } catch (InterruptedException ex) {
                result.failed(new BabuDBException(ErrorCode.INTERRUPTED,
                        "operation was interrupted", ex));
            }
        } else
            directUserDefinedLookup(udl, result);
       
View Full Code Here

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

    @Override
    public byte[] directLookup(int indexId, int snapId, byte[] key)
        throws BabuDBException {
       
        if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0)) {
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                    "index does not exist");
        }
        return lsmDB.getIndex(indexId).lookup(key, snapId);
    }
View Full Code Here

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

    @Override
    public ResultSet<byte[], byte[]> directPrefixLookup(int indexId,
            int snapId, byte[] key, boolean ascending) throws BabuDBException {
       
        if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0)) {
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                    "index does not exist");
        }
        return lsmDB.getIndex(indexId).prefixLookup(key, snapId, ascending);
    }
View Full Code Here

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

    public ResultSet<byte[], byte[]> directRangeLookup(int indexId,
            int snapId, byte[] from, byte[] to, boolean ascending)
                throws BabuDBException {
       
        if ((indexId >= lsmDB.getIndexCount()) || (indexId < 0)) {
            throw new BabuDBException(ErrorCode.NO_SUCH_INDEX,
                    "index does not exist");
        }
        return lsmDB.getIndex(indexId).rangeLookup(from, to, snapId, ascending);
    }
View Full Code Here

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

            LSN lsn = lsmDB.getOndiskLSN();
            lsmDB.writeSnapshot(dbs.getConfig().getBaseDir() + destDB +
                    File.separatorChar, ids, lsn.getViewId(),
                    lsn.getSequenceNo());
        } catch (IOException ex) {
            throw new BabuDBException(ErrorCode.IO_ERROR,
                    "cannot write snapshot: " + ex, ex.getCause());
        }
    }
View Full Code Here

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

    public void proceedWriteSnapshot(int[] snapIds, String directory, SnapshotConfig cfg)
        throws BabuDBException {
        try {
            lsmDB.writeSnapshot(directory, snapIds, cfg);
        } catch (IOException ex) {
            throw new BabuDBException(ErrorCode.IO_ERROR, "cannot write snapshot: " + ex, ex);
        }
    }
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.