Package org.rhq.server.metrics

Examples of org.rhq.server.metrics.StorageSession.execute()


    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


    }

    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

        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

        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

    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 + "}");
    }

    private void updateGCGraceSeconds(int seconds) {
        StorageSession session = storageClientManager.getSession();
View Full Code Here

    }

    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 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);
    }

    /**
     * Optimally this should be called outside of a transaction, because when scheduling an operation we
     * currently call back into {@link StorageNodeOperationsHandlerBean#handleOperationUpdateIfNecessary(OperationHistory)}.
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.