Package org.rhq.cassandra.util

Examples of org.rhq.cassandra.util.ConfigEditor.restore()


        } catch (ConfigEditorException e) {
            if (e.getCause() instanceof YAMLException) {
                log.error("Failed to update " + cassandraYamlFile);
                log.info("Attempting to restore " + cassandraYamlFile);
                try {
                    editor.restore();
                    throw e;
                } catch (ConfigEditorException e1) {
                    log.error("Failed to restore " + cassandraYamlFile + ". A copy of the file prior to any " +
                        "modifications can be found at " + editor.getBackupFile());
                    throw new ConfigEditorException("There was an error updating " + cassandraYamlFile + " and " +
View Full Code Here


        } catch (ConfigEditorException e) {
            log.error("There was an error while trying to update " + configEditor.getConfigFile(), e);
            if (e.getCause() instanceof YAMLException) {
                log.info("Attempting to restore " + configEditor.getConfigFile());
                try {
                    configEditor.restore();
                    result.setErrorMessage("Failed to update configuration file [" + configEditor.getConfigFile() + "]: " +
                        ThrowableUtil.getAllMessages(e.getCause()));
                } catch (ConfigEditorException e1) {
                    log.error("Failed to restore " + configEditor.getConfigFile() + ". A copy of the file prior to any modifications " +
                        "can be found at " + configEditor.getBackupFile());
View Full Code Here

            OperationResult startResult = startNode();
            if (startResult.getErrorMessage() != null) {
                log.error("Failed to restart storage node:\n" + startResult.getErrorMessage());
                result.setErrorMessage("Failed to restart storage node:\n" + startResult.getErrorMessage());
                // rollback here
                configEditor.restore();
                purgeDirectories(createdDataDirectories);
            } else {
                result.setSimpleResult("The storage node was succesfully updated.");
                // Commit changes, remove old directories
                configEditor.save(); // This can still throw an exception, in which case we need to rollback
View Full Code Here

        } catch (ConfigEditorException e) {
            log.error("There was an error while trying to update " + configEditor.getConfigFile(), e);
            if (e.getCause() instanceof YAMLException) {
                log.info("Attempting to restore " + configEditor.getConfigFile());
                try {
                    configEditor.restore();
                    purgeDirectories(createdDataDirectories);
                    result.setErrorMessage("Failed to update configuration file [" + configEditor.getConfigFile() + "]: " +
                            ThrowableUtil.getAllMessages(e.getCause()));
                } catch (ConfigEditorException e1) {
                    log.error("Failed to restore " + configEditor.getConfigFile() + ". A copy of the file prior to any modifications " +
View Full Code Here

            }
            return result;
        } catch (IOException e) {
            log.error("Moving datafiles failed", e);
            purgeDirectories(createdDataDirectories);
            configEditor.restore();
            result.setErrorMessage("Failed to move all the files to new destinations, " + e.getLocalizedMessage() + ". StorageService was left offline" +
                    ", investigate before restarting the node");
//            OperationResult startResult = startNode(); // return the StorageNode online, but what if IOException was out of diskspace?
            return result;
        }
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.