Package org.rhq.plugins.cassandra.util

Examples of org.rhq.plugins.cassandra.util.KeyspaceService


            return restartNode();
        } else if (name.equals("updateSeedsList")) {
            return updateSeedsList(parameters);
        } else if (name.equals("takeSnapshot")) {
            if (isStorageServiceReachable()) {
                return new TakeSnapshotOperation(new KeyspaceService(getEmsConnection()), parameters).invoke();
            } else {
                OperationResult result = new OperationResult();
                result.setErrorMessage("Unable to take snaphost, Storage Node is not available");
                return result;
            }
View Full Code Here


        return failedOperation;
    }

    public OperationResult repairKeyspace(String... columnFamilies) {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());

        String keyspace = context.getResourceKey();
        if (columnFamilies == null) {
            columnFamilies = new String[] {};
        }

        log.info("Executing repair on keyspace [" + keyspace + "]");
        long start = System.currentTimeMillis();
        keyspaceService.repair(keyspace, columnFamilies);
        long end = System.currentTimeMillis();
        log.info("Finished repair on keyspace [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        return new OperationResult();
    }

    public OperationResult repairPrimaryRange() {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
        String keyspace = context.getResourceKey();

        log.info("Executing primary range repair on keyspace [" + keyspace + "]");
        long start = System.currentTimeMillis();
        keyspaceService.repairPrimaryRange(keyspace);
        long end = System.currentTimeMillis();
        log.info("Finished primary range repair on keyspace [" + keyspace + " in (" + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        return new OperationResult();
    }

    public OperationResult cleanup() {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
        String keyspace = context.getResourceKey();

        log.info("Executing cleanup on keyspace [" + keyspace + "]");
        long start = System.currentTimeMillis();
        keyspaceService.cleanup(keyspace);
        long end = System.currentTimeMillis();

        log.info("Finished cleanup on keyspace [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
View Full Code Here

        return new OperationResult();
    }

    public OperationResult compactKeyspace(String... columnFamilies) {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());

        String keyspace = context.getResourceKey();
        if (columnFamilies == null) {
            columnFamilies = new String[] {};
        }

        log.info("Executing compaction on  keyspace [" + keyspace + "]");
        long start = System.currentTimeMillis();
        keyspaceService.compact(keyspace, columnFamilies);
        long end = System.currentTimeMillis();
        log.info("Finished compaction on keysapce [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        return ipAddresses;
    }

    private void createSnapshots(Set<String> addressesToAdd, String snapshotPrefix) {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
        keyspaceService.takeSnapshot(new String[] { SYSTEM_KEYSPACE, SYSTEM_AUTH_KEYSPACE, RHQ_KEYSPACE },
            snapshotPrefix + System.currentTimeMillis());
    }
View Full Code Here

    private OperationResult performTopologyChangeMaintenance(Configuration params) {
        boolean runRepair = params.getSimple("runRepair").getBooleanValue();
        boolean updateSeedsList = params.getSimple("updateSeedsList").getBooleanValue();

        EmsConnection emsConnection = getEmsConnection();
        KeyspaceService keyspaceService = new KeyspaceService(emsConnection);
        boolean hasErrors = false;
        OperationResult result = new OperationResult();
        Configuration resultConfig = result.getComplexResults();
        PropertyList resultsList = new PropertyList("results");
View Full Code Here

        }
        return result;
    }

    private OperationResult repair() {
        KeyspaceService keyspaceService = new KeyspaceService(getEmsConnection());
        OperationResult result = new OperationResult();
        Configuration resultConfig = result.getComplexResults();
        PropertyList resultsList = new PropertyList("results");

        OpResult opResult = repairKeyspace(keyspaceService, RHQ_KEYSPACE);
View Full Code Here

TOP

Related Classes of org.rhq.plugins.cassandra.util.KeyspaceService

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.