Package org.xtreemfs.babudb.api.exception

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


        if (dbsByName.containsKey(sourceDB)) {
            dbsByName.put(destDB, dbsByName.get(sourceDB));
            dbsById.put(Integer.valueOf(destDB), dbsByName.get(sourceDB));
            dbsOnDisk.put(destDB, dbsByName.get(sourceDB));
        } else {
            throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, "Test-copy failed!");
        }
    }
View Full Code Here


        if (!dbsByName.containsKey(databaseName)) {
            DatabaseInternal result = new DatabaseMock(databaseName, numIndices, comparators);
            dbsByName.put(databaseName, result);
            return result;
        } else {
            throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, "Test-create failed!");
        }
    }
View Full Code Here

    public void deleteDatabase(String databaseName) throws BabuDBException {
       
        if (dbsByName.containsKey(databaseName)) {
            dbsByName.remove(databaseName);
        } else {
            throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, "Test-remove failed!");
        }
    }
View Full Code Here

        Logging.logMessage(Logging.LEVEL_ERROR, this, "Accessing dbName '%s' from mock.", dbName);
       
        if (dbsByName.containsKey(dbName)) {
            return dbsByName.get(dbName);
        } else {
            throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, "Test-getDB(" + dbName
                    + ") failed!");
        }
    }
View Full Code Here

        Logging.logMessage(Logging.LEVEL_ERROR, this, "Accessing dbId '%d' from mock.", dbId);
       
        if (dbsById.containsKey(dbId)) {
            return dbsById.get(dbId);
        } else {
            throw new BabuDBException(ErrorCode.BROKEN_PLUGIN, "Test-getDB(" + dbId + ") failed!");
        }
    }
View Full Code Here

    @Override
    public void makePersistent(TransactionInternal txn, ReusableBuffer serialized,
            BabuDBRequestResultImpl<Object> future) throws BabuDBException {
   
        if (lock.get()) {
            throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, "Serivce has been locked!");
        } else {
            synchronized (onDisk) {
                LSN lsn = onDisk.get();
                lsn = new LSN(lsn.getViewId(), lsn.getSequenceNo() + 1L);
                onDisk.set(lsn);
View Full Code Here

                    try {
                        while (isLocked()) {
                            accessCounter.wait();
                        }
                    } catch (InterruptedException e) {
                        throw new BabuDBException(ErrorCode.INTERRUPTED,
                                "Waiting for a lease holder was interrupted.", e);   
                    }
                    accessCounter.incrementAndGet();
                }
                executeLocallyAndReplicate(txn, serialized, future);
View Full Code Here

       
        InetSocketAddress master;
        try {
            master = replMan.getMaster();
        } catch (InterruptedException e) {
            throw new BabuDBException(ErrorCode.INTERRUPTED,
                    "Waiting for a lease holder was interrupted.", e);
        }
              
        if ((replMan.isItMe(master)) ||
               
View Full Code Here

         * @see org.xtreemfs.babudb.replication.service.clients.ClientResponseFuture.
         *              ClientResponseAvailableListener#requestFailed(java.lang.Exception)
         */
        @Override
        public void requestFailed(Exception e) {
            BabuDBException be = new BabuDBException(
                    ErrorCode.REPLICATION_FAILURE, e.getMessage());
           
            if (e instanceof ErrorCodeException) {
                be = new BabuDBException(mapTransmissionError(
                        ((ErrorCodeException) e).getCode()),e.getMessage());
            }
            requestFuture.failed(be);
        }
View Full Code Here

         *              java.lang.Exception)
         */
        @Override
        public void failed(Exception ex) {
            requestFuture.failed(
                    new BabuDBException(ErrorCode.REPLICATION_FAILURE, ex.getMessage()));
        }
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.