Skip to content

Commit

Permalink
[HWKMETRICS-606] change compaction strategy of metrics_idx to STCS
Browse files Browse the repository at this point in the history
  • Loading branch information
John Sanda committed Apr 10, 2017
1 parent e0a0c98 commit 76782c0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void run(Session session, String keyspace, boolean resetDB) {

session.execute("INSERT INTO " + keyspace + ".sys_config (config_id, name, value) VALUES " +
"('org.hawkular.metrics', 'version', '" + getNewHawkularMetricsVersion() + "')");

updateMetricsIdxCompactionStrategy(session, keyspace);
}

private URI getScript() {
Expand All @@ -76,6 +78,13 @@ private URI getScript() {
}
}

private void updateMetricsIdxCompactionStrategy(Session session, String keyspace) {
// This change is being done outside of Cassalog because it has to be applied to multiple branches and Cassalog
// does not yet support this upgrade scenario. See https://github.com/hawkular/cassalog/issues/6 for more info.
session.execute("ALTER TABLE " + keyspace +
".metrics_idx WITH compaction = {'class': 'SizeTieredCompactionStrategy'}");
}

@SuppressWarnings("unused")
private boolean systemSettingsTableExists(Session session, String keyspace) {
Statement statement = new SimpleStatement("SELECT * FROM sysconfig.schema_columnfamilies WHERE " +
Expand Down

0 comments on commit 76782c0

Please sign in to comment.