Skip to content

Commit

Permalink
[HWKMETRICS-487] Avoid purging sys_config table since it is a static …
Browse files Browse the repository at this point in the history
…data table.
  • Loading branch information
Stefan Negrea committed Sep 29, 2016
1 parent 15b1f62 commit fbffdb2
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -117,9 +117,11 @@ public void start() {
}

public void truncateTables(String keyspace) {
//TODO: The filtering below for static data tables is prone to error. Find a better way to avoid
//truncating those tables.
session.execute("select table_name from system_schema.tables where keyspace_name = '" + keyspace + "'")
.flatMap(Observable::from)
.filter(row -> !row.getString(0).equals("cassalog"))
.filter(row -> !row.getString(0).equals("cassalog") && !row.getString(0).equals("sys_config"))
.flatMap(row -> session.execute("truncate " + row.getString(0)))
.toCompletable()
.await(10, TimeUnit.SECONDS);
Expand Down

0 comments on commit fbffdb2

Please sign in to comment.