cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/6] cassandra git commit: cancel latency-sampling task when CF is dropped patch by jbellis; reviewed by ayeschenko for CASSANDRA-8401
Date Tue, 02 Dec 2014 22:07:33 GMT
cancel latency-sampling task when CF is dropped
patch by jbellis; reviewed by ayeschenko for CASSANDRA-8401


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/4030088e
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/4030088e
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/4030088e

Branch: refs/heads/trunk
Commit: 4030088ec1df44a666ce73306eae5daf664b25ab
Parents: eb0424e
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Dec 2 16:04:47 2014 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Dec 2 16:04:47 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/db/ColumnFamilyStore.java | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4030088e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 3febed0..dc3896d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.12:
+ * cancel latency-sampling task when CF is dropped (CASSANDRA-8401)
  * don't block SocketThread for MessagingService (CASSANDRA-8188)
  * Increase quarantine delay on replacement (CASSANDRA-8260)
  * Expose off-heap memory usage stats (CASSANDRA-7897)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4030088e/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index 06520ab..6cdf9e9 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -107,6 +107,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
 
     public final ColumnFamilyMetrics metric;
     public volatile long sampleLatencyNanos;
+    private final ScheduledFuture<?> latencyCalculator;
 
     public void reload()
     {
@@ -292,7 +293,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
             throw new RuntimeException(e);
         }
         logger.debug("retryPolicy for {} is {}", name, this.metadata.getSpeculativeRetry());
-        StorageService.optionalTasks.scheduleWithFixedDelay(new Runnable()
+        latencyCalculator = StorageService.optionalTasks.scheduleWithFixedDelay(new Runnable()
         {
             public void run()
             {
@@ -331,8 +332,8 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
             logger.warn("Failed unregistering mbean: " + mbeanName, e);
         }
 
+        latencyCalculator.cancel(false);
         compactionStrategy.shutdown();
-
         SystemKeyspace.removeTruncationRecord(metadata.cfId);
         data.unreferenceSSTables();
         indexManager.invalidate();


Mime
View raw message