Package org.xtreemfs.babudb.api.exception

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


            LSN latest = null;
            Map<ClientInterface ,LSN> states = getStates(slaves, true);
       
            // getting enough slaves has failed
            if (states.size() < localSyncN) {
                throw new BabuDBException(ErrorCode.REPLICATION_FAILURE,
                        "Not enough slaves available to synchronize with!");
               
            } else {
               
                List<LSN> values = new LinkedList<LSN>(states.values());
View Full Code Here


    @Override
    public void shutdown(boolean graceful) throws BabuDBException {
        try {
            replMan.shutdown();
        } catch (Exception e) {
            throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.getMessage());
        } finally {
            localBabuDB.shutdown(graceful);
        }
    }
View Full Code Here

     * Use this function to update the permitted failures on this response.
     */
    public synchronized void decrementPermittedFailures(){
        if (permittedFailures == 0 && !finished) {
            finished = true;
            listener.failed(new BabuDBException(ErrorCode.REPLICATION_FAILURE,
                    "LogEntry could not be replicated!"));
        }
        permittedFailures--;
    }
View Full Code Here

        // load the plugins configuration
        ReplicationConfig configuration;
        try {
            configuration = new ReplicationConfig(configPath, babuDB.getConfig());
        } catch (IOException ioe) {
            throw new BabuDBException(ErrorCode.REPLICATION_FAILURE,
                    "Replication configuration is broken.", ioe.getCause());
        }
       
        // replay the backup, if available
        try {
            new FileIO(configuration).replayBackupFiles();
        } catch (IOException io) {
            Logging.logMessage(Logging.LEVEL_ERROR, this, "Could not retrieve" +
                " the slave backup files, because: ", io.getMessage());
        }
       
        // initialize the replication services
        ReplicationManager replMan;
        try {
            replMan = new ReplicationManager(babuDB, configuration);          
        } catch (Exception e) {
            if (e.getMessage() == null) Logging.logError(Logging.LEVEL_ERROR, this, e);
            throw new BabuDBException(ErrorCode.REPLICATION_FAILURE,
                    e.getMessage(), e.getCause());
        }
       
        // initialize the BabuDB proxy interface
        return new BabuDBProxy(babuDB, replMan, configuration.getReplicationPolicy());
View Full Code Here

                        listener.finished(rp, context);
                    }

                    @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());
                        }
                           
                        listener.failed(be, context);
                    }
                });
            }
           
            @Override
            public byte[] get() throws BabuDBException {
                try {
                    return r.get();
                } catch (ErrorCodeException ece) {
                    throw new BabuDBException(mapTransmissionError(ece.getCode()),ece.getMessage());
                } catch (Exception e) {
                    throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.getMessage());
                }
            }
        };
    }
View Full Code Here

                        listener.finished(rp, context);
                    }

                    @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());
                        }
                           
                        listener.failed(be, context);
                    }
                });
            }
           
            @Override
            public ResultSet<byte[], byte[]> get() throws BabuDBException {
                try {
                    return r.get();
                } catch (ErrorCodeException ece) {
                    throw new BabuDBException(mapTransmissionError(ece.getCode()),ece.getMessage());
                } catch (Exception e) {
                    throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.getMessage());
                }
            }
        };
    }
View Full Code Here

                        listener.finished(rp, context);
                    }

                    @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());
                        }
                           
                        listener.failed(be, context);
                    }
                });
            }
           
            @Override
            public ResultSet<byte[], byte[]> get() throws BabuDBException {
                try {
                    return r.get();
                } catch (ErrorCodeException ece) {
                    throw new BabuDBException(mapTransmissionError(ece.getCode()),ece.getMessage());
                } catch (Exception e) {
                    throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.getMessage());
                }
            }
        };
    }
View Full Code Here

                        listener.finished(rp, context);
                    }

                    @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());
                        }
                           
                        listener.failed(be, context);
                    }
                });
            }
           
            @Override
            public ResultSet<byte[], byte[]> get() throws BabuDBException {
                try {
                    return r.get();
                } catch (ErrorCodeException ece) {
                    throw new BabuDBException(mapTransmissionError(ece.getCode()),ece.getMessage());
                } catch (Exception e) {
                    throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.getMessage());
                }
            }
        };
    }
View Full Code Here

                case SERVICE_UNAVAILABLE :
                    // --> empty the queue to ensure a clean restart
                default :
                    Logging.logError(Logging.LEVEL_WARN, this, cle);
                    if (listener != null) {
                        listener.failed(new BabuDBException(
                                ErrorCode.REPLICATION_FAILURE,
                                cle.getMessage()));
                        listener = null;
                    }
                   
View Full Code Here

                        listener.finished(rp, context);
                    }

                    @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());
                        }
                           
                        listener.failed(be, context);
                    }
                });
            }
           
            @Override
            public ResultSet<byte[], byte[]> get() throws BabuDBException {
                try {
                    return r.get();
                } catch (ErrorCodeException ece) {
                    throw new BabuDBException(mapTransmissionError(ece.getCode()),ece.getMessage());
                } catch (Exception e) {
                    throw new BabuDBException(ErrorCode.REPLICATION_FAILURE, e.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.