diff --git a/CHANGES.txt b/CHANGES.txt index f14cf1e6c1..e8d8612bf5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 5.1 + * Expose StorageService.dropPreparedStatements via JMX (CASSANDRA-20870) * Expose Metric for Prepared Statement Cache Size (in bytes) (CASSANDRA-20864) * Add support for BEGIN TRANSACTION to allow mutations that touch multiple partitions (CASSANDRA-20857) * AutoRepair: Safeguard Full repair against disk protection(CASSANDRA-20045) diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index 2c692932c3..8d861618a5 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -2756,6 +2756,12 @@ public class StorageService extends NotificationBroadcasterSupport implements IE return statements; } + @Override + public void dropPreparedStatements(boolean memoryOnly) + { + QueryProcessor.instance.clearPreparedStatements(memoryOnly); + } + public void forceKeyspaceCompaction(boolean splitOutput, String keyspaceName, String... tableNames) throws IOException, ExecutionException, InterruptedException { for (ColumnFamilyStore cfStore : getValidColumnFamilies(true, false, keyspaceName, tableNames)) diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java index 5d4781c546..e5cbd980c4 100644 --- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java +++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java @@ -1375,6 +1375,9 @@ public interface StorageServiceMBean extends NotificationEmitter void setPaxosRepairRaceWait(boolean paxosRepairCoordinatorWait); boolean getPaxosRepairRaceWait(); + + public void dropPreparedStatements(boolean memoryOnly); + // Comma delimited list of "nodeId=dc:rack" or "endpoint=dc:rack" void alterTopology(String updates); /** Gets the names of all tables for the given keyspace */