Skip to content

Commit

Permalink
support use of Postgresql as storage backend for multiple reapers
Browse files Browse the repository at this point in the history
  • Loading branch information
Saleil-Bhat authored and adejanovski committed Oct 16, 2019
1 parent 96287df commit aa833d8
Show file tree
Hide file tree
Showing 24 changed files with 2,088 additions and 85 deletions.
94 changes: 55 additions & 39 deletions .travis.yml
Expand Up @@ -46,88 +46,104 @@ jobs:
fast_finish: true
allow_failures:
- env: TEST_TYPE=docker
- env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk
- env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=1 GRIM_MAX=1
- env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=2
- env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=4
include:
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 1.2.19
env: TEST_TYPE=ccm CASSANDRA_VERSION=1.2.19 CUCUMBER_OPTIONS="--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 1.2.19
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=1.2.19 CUCUMBER_OPTIONS="--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 2.0.17
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.0.17 CUCUMBER_OPTIONS="--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 2.0.17
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=2.0.17 CUCUMBER_OPTIONS="--tags ~@cassandra_2_1_onwards --tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 2.1.20
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.1.20 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 2.1.20
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=2.1.20 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 2.2.13
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.2.13 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 2.2.13
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=2.2.13 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 3.0.17
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.0.17 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 3.0.17
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=3.0.17 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 3.11.4
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.11.4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Memory and H2 reaping Cassandra 3.11.4
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=3.11.4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Memory, H2 and Postgresql reaping Cassandra 4.0
env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk
name: Memory and H2 reaping Cassandra 4.0
env: TEST_TYPE=ccm STORAGE_TYPE=local CASSANDRA_VERSION=github:apache/trunk
- stage: Integration Tests
name: Cassandra 2.1.20
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.1.20 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Cassandra reaping Cassandra 2.1.20
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.1.20 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Cassandra 2.2.13
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.2.13 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Cassandra reaping Cassandra 2.2.13
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.2.13 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Cassandra 3.0.17
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.0.17 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Cassandra reaping Cassandra 3.0.17
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.0.17 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Cassandra 3.11.3
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
name: Cassandra reaping Cassandra 3.11.3
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Integration Tests
name: Cassandra 4.0
env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=1 GRIM_MAX=1
name: Cassandra reaping Cassandra 4.0
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=1 GRIM_MAX=1
- stage: Integration Tests
name: Postgresql reaping Cassandra 3.11.3
env: TEST_TYPE=ccm STORAGE_TYPE=postgresql CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 2.1.20
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.1.20 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.1.20 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 2.2.13
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.2.13 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.2.13 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 3.0.17
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.0.17 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.0.17 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 3.11.3
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 4.0
env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=2
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=2
- stage: Distributed Reaper Integration Tests
name: Two Reapers on Cassandra 3.11.3 with Postgresql backend
env: TEST_TYPE=ccm STORAGE_TYPE=postgresql CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=2 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 2.1.20
env: TEST_TYPE=sidecar CASSANDRA_VERSION=2.1.20 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
env: TEST_TYPE=sidecar STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.1.20 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 2.2.13
env: TEST_TYPE=sidecar CASSANDRA_VERSION=2.2.13 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
env: TEST_TYPE=sidecar STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.2.13 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 3.0.17
env: TEST_TYPE=sidecar CASSANDRA_VERSION=3.0.17 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
env: TEST_TYPE=sidecar STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.0.17 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 3.11.3
env: TEST_TYPE=sidecar CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
env: TEST_TYPE=sidecar STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 4.0
env: TEST_TYPE=sidecar CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags @sidecar"
env: TEST_TYPE=sidecar STORAGE_TYPE=cassandra CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags @sidecar"
- stage: Sidecar Integration Tests
name: Sidecar on Cassandra 3.11.3 with Postgresql backend
env: TEST_TYPE=sidecar STORAGE_TYPE=postgresql CASSANDRA_VERSION=3.11.3 GRIM_MIN=1 GRIM_MAX=1 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards --tags @sidecar"
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 2.1.20
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.1.20 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.1.20 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 2.2.13
env: TEST_TYPE=ccm CASSANDRA_VERSION=2.2.13 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=2.2.13 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 3.0.17
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.0.17 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.0.17 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 3.11.3
env: TEST_TYPE=ccm CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 4.0
env: TEST_TYPE=ccm CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=4
env: TEST_TYPE=ccm STORAGE_TYPE=cassandra CASSANDRA_VERSION=github:apache/trunk GRIM_MIN=2 GRIM_MAX=4
- stage: Flapping Distributed Reaper Integration Tests
name: Four Flapping Reaper on Cassandra 3.11.3 with Postgresql backend
env: TEST_TYPE=ccm STORAGE_TYPE=postgresql CASSANDRA_VERSION=3.11.3 GRIM_MIN=2 GRIM_MAX=4 CUCUMBER_OPTIONS="--tags ~@cassandra_4_0_onwards"
# Upgrade Integration Tests are broken due to classloading issues around org.glassfish.jersey.internal.spi.AutoDiscoverable
# - stage: Upgrade Integration Tests
# name: Upgrading Reaper on Cassandra 2.1.20 (all_nodes_reachable)
Expand Down
6 changes: 2 additions & 4 deletions src/ci/before_script.sh
Expand Up @@ -22,10 +22,8 @@ case "${TEST_TYPE}" in
echo "ERROR: Environment variable TEST_TYPE is unspecified."
exit 1
;;
"ccm")
if [ "x${GRIM_MIN}" = "x" ] ; then
psql -c 'create database reaper;' -U postgres
fi
"ccm"|"sidecar")
psql -c 'create database reaper;' -U postgres
;;
*)
echo "Skipping, no actions for TEST_TYPE=${TEST_TYPE}."
Expand Down
54 changes: 41 additions & 13 deletions src/ci/script.sh
Expand Up @@ -41,26 +41,54 @@ case "${TEST_TYPE}" in
sleep 30
ccm status

if [ "x${GRIM_MIN}" = "x" ]
then
mvn -B package
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperShiroIT
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperIT
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperH2IT
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperPostgresIT
else
mvn -B package -DskipTests
mvn -B surefire:test -DsurefireArgLine="-Xmx384m" -Dtest=ReaperCassandraIT -Dgrim.reaper.min=${GRIM_MIN} -Dgrim.reaper.max=${GRIM_MAX}
fi
case "${STORAGE_TYPE}" in
"")
echo "ERROR: Environment variable STORAGE_TYPE is unspecified."
exit 1
;;
"local")
mvn -B package
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperShiroIT
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperIT
mvn -B surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperH2IT
;;
"postgresql")
mvn -B package -DskipTests
mvn -B surefire:test -DsurefireArgLine="-Xmx384m" -Dtest=ReaperPostgresIT -Dgrim.reaper.min=${GRIM_MIN} -Dgrim.reaper.max=${GRIM_MAX}
;;
"cassandra")
mvn -B package -DskipTests
mvn -B surefire:test -DsurefireArgLine="-Xmx384m" -Dtest=ReaperCassandraIT -Dgrim.reaper.min=${GRIM_MIN} -Dgrim.reaper.max=${GRIM_MAX}
;;
*)
echo "Skipping, no actions for STORAGE_TYPE=${STORAGE_TYPE}."
;;
esac

;;
"sidecar")
mvn --version -B
mvn -B package -DskipTests
ccm start
sleep 30
ccm status

mvn -B package -DskipTests
mvn -B surefire:test -DsurefireArgLine="-Xmx512m" -Dtest=ReaperCassandraSidecarIT
case "${STORAGE_TYPE}" in
"")
echo "ERROR: Environment variable STORAGE_TYPE is unspecified."
exit 1
;;
"postgresql")
mvn -B surefire:test -DsurefireArgLine="-Xmx512m" -Dtest=ReaperPostgresSidecarIT -Dcucumber.options="-t @sidecar"
;;
"cassandra")
mvn -B surefire:test -DsurefireArgLine="-Xmx512m" -Dtest=ReaperCassandraSidecarIT -Dcucumber.options="-t @sidecar"
;;
*)
echo "Skipping, no actions for STORAGE_TYPE=${STORAGE_TYPE}."
;;
esac

;;
"upgrade")
mvn --version -B
Expand Down
5 changes: 5 additions & 0 deletions src/server/pom.xml
Expand Up @@ -296,6 +296,11 @@
<version>0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibatis</groupId>
<artifactId>ibatis2-common</artifactId>
<version>2.1.7.597</version>
</dependency>
</dependencies>

<build>
Expand Down
16 changes: 13 additions & 3 deletions src/server/src/main/java/io/cassandrareaper/ReaperApplication.java
Expand Up @@ -75,6 +75,7 @@
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.dropwizard.DropwizardExports;
import io.prometheus.client.exporter.MetricsServlet;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.HttpClient;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.session.SessionHandler;
Expand Down Expand Up @@ -441,9 +442,18 @@ private IStorage initializeStorage(ReaperApplicationConfiguration config, Enviro
|| "database".equalsIgnoreCase(config.getStorageType())) {
// create DBI instance
final DBIFactory factory = new DBIFactory();

// instanciate store
storage = new PostgresStorage(factory.build(environment, config.getDataSourceFactory(), "postgresql"));
if (StringUtils.isEmpty(config.getDataSourceFactory().getDriverClass())
&& "postgres".equalsIgnoreCase(config.getStorageType())) {
config.getDataSourceFactory().setDriverClass("org.postgresql.Driver");
} else if (StringUtils.isEmpty(config.getDataSourceFactory().getDriverClass())
&& "h2".equalsIgnoreCase(config.getStorageType())) {
config.getDataSourceFactory().setDriverClass("org.h2.Driver");
}
// instantiate store
storage = new PostgresStorage(
context.reaperInstanceId,
factory.build(environment, config.getDataSourceFactory(), "postgresql")
);
initDatabase(config);
} else {
LOG.error("invalid storageType: {}", config.getStorageType());
Expand Down
Expand Up @@ -21,6 +21,7 @@
import io.cassandrareaper.ReaperException;
import io.cassandrareaper.core.Cluster;
import io.cassandrareaper.core.RepairRun;
import io.cassandrareaper.storage.IDistributedStorage;

import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -73,6 +74,7 @@ public Integer purgeDatabase() throws ReaperException {
}
}
}
purgeMetrics();
return purgedRuns;
}

Expand Down Expand Up @@ -130,4 +132,19 @@ private int purgeRepairRunsByDate(Collection<RepairRun> repairRuns) {

return purgedRuns.get();
}

/**
* Purges all expired metrics from storage. Expiration time is a property of the storage, stored either in
* the schema itself for databases with TTL or in the storage instance for databases which must be purged manually
*/
private void purgeMetrics() {
if (context.storage instanceof IDistributedStorage) {
IDistributedStorage storage = ((IDistributedStorage) context.storage);
if (context.config.isInSidecarMode()) {
storage.purgeMetrics();
storage.purgeNodeOperations();
}
storage.purgeNodeMetrics();
}
}
}
Expand Up @@ -1522,6 +1522,9 @@ public void deleteNodeMetrics(UUID runId, String node) {
session.executeAsync(delNodeMetricsByNodePrepStmt.bind(minute, runId, node));
}

@Override
public void purgeNodeMetrics() {}

private static NodeMetrics createNodeMetrics(Row row) {
return NodeMetrics.builder()
.withNode(row.getString("node"))
Expand Down Expand Up @@ -1830,6 +1833,9 @@ public void storeMetric(GenericMetric metric) {
metric.getValue()));
}

@Override
public void purgeMetrics() {}

@Override
public void storeOperations(String clusterName, OpType operationType, String host, String operationsJson) {
session.executeAsync(
Expand All @@ -1853,4 +1859,7 @@ public String listOperations(String clusterName, OpType operationType, String ho
: operations.one().getString("data");
}

@Override
public void purgeNodeOperations() {}

}
Expand Up @@ -80,4 +80,19 @@ List<GenericMetric> getMetrics(
void storeOperations(String clusterName, OpType operationType, String host, String operationsJson);

String listOperations(String clusterName, OpType operationType, String host);

/**
* Purges old node metrics from the database (no-op for databases with TTL)
*/
void purgeNodeMetrics();

/**
* Purges old metrics from the database (no-op for databases w/ TTL)
*/
void purgeMetrics();

/**
* Purges old node operation info from the database (no-op for databases w/ TTL)
*/
void purgeNodeOperations();
}

0 comments on commit aa833d8

Please sign in to comment.