Configurie BatchlogManager to stop delayed tasks on shutdown

patch by Caleb Rackliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-11062


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

Branch: refs/heads/trunk
Commit: 0a1cfaaceade1317e9fc802d77e39371e745dee3
Parents: 23f6296
Author: Caleb Rackliffe <caleb.rackl...@gmail.com>
Authored: Fri Jan 22 18:04:09 2016 -0800
Committer: Aleksey Yeschenko <alek...@apache.org>
Committed: Mon Feb 8 13:08:38 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 src/java/org/apache/cassandra/batchlog/BatchlogManager.java | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0a1cfaac/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6302ce6..1fbe301 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.4
+ * Configurie BatchlogManager to stop delayed tasks on shutdown 
(CASSANDRA-11062)
  * Hadoop integration is incompatible with Cassandra Driver 3.0.0 
(CASSANDRA-11001)
 Merged from 2.2.6
  * (cqlsh) Support utf-8/cp65001 encoding on Windows (CASSANDRA-11030)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0a1cfaac/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/batchlog/BatchlogManager.java 
b/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
index 1c98c2a..7ccc6f8 100644
--- a/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
@@ -72,7 +72,14 @@ public class BatchlogManager implements BatchlogManagerMBean
     private volatile UUID lastReplayedUuid = UUIDGen.minTimeUUID(0);
 
     // Single-thread executor service for scheduling and serializing log 
replay.
-    private final ScheduledExecutorService batchlogTasks = new 
DebuggableScheduledThreadPoolExecutor("BatchlogTasks");
+    private final ScheduledExecutorService batchlogTasks;
+
+    public BatchlogManager()
+    {
+        ScheduledThreadPoolExecutor executor = new 
DebuggableScheduledThreadPoolExecutor("BatchlogTasks");
+        executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
+        batchlogTasks = executor;
+    }
 
     public void start()
     {

Reply via email to