activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject [3/4] activemq git commit: https://issues.apache.org/jira/browse/AMQ-6203
Date Tue, 12 Apr 2016 13:32:45 GMT
https://issues.apache.org/jira/browse/AMQ-6203

Adding a flag to enable or disable Ack Compaction
Currently defaults to enabled for 5.14.0 and above

(cherry picked from commit cbad8babe507f63cc80e42fe37070b898d4d8dbc)


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

Branch: refs/heads/activemq-5.13.x
Commit: b8ac1b4c561da2087d923c3a32e9bc2624c508ea
Parents: 72eecbe
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Tue Apr 12 13:30:10 2016 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Tue Apr 12 13:31:35 2016 +0000

----------------------------------------------------------------------
 .../store/kahadb/KahaDBPersistenceAdapter.java  | 18 +++++++++++++++++
 .../activemq/store/kahadb/MessageDatabase.java  | 21 +++++++++++++++++++-
 2 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/b8ac1b4c/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
index b6b2ca7..21cac0a 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/KahaDBPersistenceAdapter.java
@@ -669,6 +669,24 @@ public class KahaDBPersistenceAdapter extends LockableServiceSupport
implements
         this.letter.setCompactAcksIgnoresStoreGrowth(compactAcksIgnoresStoreGrowth);
     }
 
+    /**
+     * Returns whether Ack compaction is enabled
+     *
+     * @return enableAckCompaction
+     */
+    public boolean isEnableAckCompaction() {
+        return letter.isEnableAckCompaction();
+    }
+
+    /**
+     * Configure if the Ack compaction task should be enabled to run
+     *
+     * @param enableAckCompaction
+     */
+    public void setEnableAckCompaction(boolean enableAckCompaction) {
+        letter.setEnableAckCompaction(enableAckCompaction);
+    }
+
     public KahaDBStore getStore() {
         return letter;
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/b8ac1b4c/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
----------------------------------------------------------------------
diff --git a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
index 434e49c..8bb9491 100644
--- a/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
+++ b/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/MessageDatabase.java
@@ -274,6 +274,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
     private boolean enableIndexPageCaching = true;
     ReentrantReadWriteLock checkpointLock = new ReentrantReadWriteLock();
 
+    private boolean enableAckCompaction = true;
     private int compactAcksAfterNoGC = 10;
     private boolean compactAcksIgnoresStoreGrowth = false;
     private int checkPointCyclesWithNoGC;
@@ -1817,7 +1818,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
                 if (ackMessageFileMapMod) {
                     checkpointUpdate(tx, false);
                 }
-            } else {
+            } else if (isEnableAckCompaction()) {
                 if (++checkPointCyclesWithNoGC >= getCompactAcksAfterNoGC()) {
                     // First check length of journal to make sure it makes sense to even
try.
                     //
@@ -3671,4 +3672,22 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
     public void setCompactAcksIgnoresStoreGrowth(boolean compactAcksIgnoresStoreGrowth) {
         this.compactAcksIgnoresStoreGrowth = compactAcksIgnoresStoreGrowth;
     }
+
+    /**
+     * Returns whether Ack compaction is enabled
+     *
+     * @return enableAckCompaction
+     */
+    public boolean isEnableAckCompaction() {
+        return enableAckCompaction;
+    }
+
+    /**
+     * Configure if the Ack compaction task should be enabled to run
+     *
+     * @param enableAckCompaction
+     */
+    public void setEnableAckCompaction(boolean enableAckCompaction) {
+        this.enableAckCompaction = enableAckCompaction;
+    }
 }


Mime
View raw message