Package org.rhq.server.metrics

Examples of org.rhq.server.metrics.StorageSession


        dataManager.mergeMeasurementReport(dummyReport);
    }

    private void purgeMetricsTables() {
        try {
            StorageSession session = storageClientManager.getSession();
            for (Table table : Table.values()) {
                session.execute("TRUNCATE " + table.getTableName());
            }
        } catch (NoHostAvailableException e) {
            throw new RuntimeException("An error occurred while purging metrics tables", e);
        }
    }
View Full Code Here


        metricsDAO.insert1HourData(metric);
    }

    private void deleteMeasurementDataNumeric1H(MeasurementSchedule schedule) {
        try {
            StorageSession session = storageClientManager.getSession();
            session.execute("DELETE FROM " + MetricsTable.AGGREGATE.getTableName() + " WHERE schedule_id = " +
                schedule.getId() + " AND bucket = 'one_hour'");
        } catch (NoHostAvailableException e) {
            throw new RuntimeException("An error occurred while trying to deleted data from "
                + MetricsTable.AGGREGATE.getTableName() + " for " + schedule, e);
        }
View Full Code Here

    private void updateStorageClusterCredentials(StorageClusterSettings newClusterSettings) {
        SystemSettings currentSettings = systemManager.getUnmaskedSystemSettings(true);
        String currentPassword = currentSettings.get(SystemSetting.STORAGE_PASSWORD);

        if (!currentPassword.equals(newClusterSettings.getPasswordHash())) {
            StorageSession session = this.storageClienManager.getSession();
            session.execute(String.format(UPDATE_PASSWORD_QUERY, currentSettings.get(SystemSetting.STORAGE_USERNAME),
                newClusterSettings.getPasswordHash()));
        }
    }
View Full Code Here

        LOG.info("Initializing storage client subsystem");

        try {
            Session wrappedSession = createSession();
            session = new StorageSession(wrappedSession);

            storageClusterMonitor = new StorageClusterMonitor(session);
            session.addStorageStateListener(storageClusterMonitor);

            metricsConfiguration = new MetricsConfiguration();
View Full Code Here

        return isRepairNeeded;
    }

    private void updateReplicationFactor(int replicationFactor) {
        StorageSession session = storageClientManager.getSession();
        session.execute("ALTER KEYSPACE rhq WITH replication = {'class': 'SimpleStrategy', 'replication_factor': "
            + replicationFactor + "}");
        session.execute("ALTER KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', "
            + "'replication_factor': " + replicationFactor + "}");
    }
View Full Code Here

        session.execute("ALTER KEYSPACE system_auth WITH replication = {'class': 'SimpleStrategy', "
            + "'replication_factor': " + replicationFactor + "}");
    }

    private void updateGCGraceSeconds(int seconds) {
        StorageSession session = storageClientManager.getSession();
        for (Table table : Table.values()) {
            session.execute("ALTER TABLE " + table.getTableName() + " WITH gc_grace_seconds = " + seconds);
        }
        session.execute("ALTER TABLE rhq.schema_version WITH gc_grace_seconds = " + seconds);
    }
View Full Code Here

    private void initializeMetricsServer(SimulationPlan plan) {
        metrics = new Metrics();
        createSchema(plan.getNodes(), plan.getCqlPort());
        session = createSession(plan.getNodes(), plan.getCqlPort());
        storageSession = new StorageSession(session);
        metricsDAO = new MetricsDAO(storageSession, plan.getMetricsServerConfiguration());

        metricsServer = new MetricsServer();
        metricsServer.setDAO(metricsDAO);
        metricsServer.setConfiguration(plan.getMetricsServerConfiguration());
View Full Code Here

TOP

Related Classes of org.rhq.server.metrics.StorageSession

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.