activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: AMQ-4399: Allow to configure checkpoint interval on jdbc persistence adapter.
Date Sun, 30 Mar 2014 07:19:54 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 4927c54a0 -> d77014aa5


AMQ-4399: Allow to configure checkpoint interval on jdbc persistence adapter.


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

Branch: refs/heads/trunk
Commit: d77014aa5d8b8c9869c8ab7ba9f27edabb052496
Parents: 4927c54
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Sun Mar 30 09:23:14 2014 +0200
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Sun Mar 30 09:23:14 2014 +0200

----------------------------------------------------------------------
 .../store/journal/JournalPersistenceAdapter.java        | 12 ++++++++++--
 .../store/journal/JournalPersistenceAdapterFactory.java | 10 ++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/d77014aa/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
----------------------------------------------------------------------
diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
index 4832472..565fc9f 100755
--- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
+++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapter.java
@@ -98,7 +98,7 @@ public class JournalPersistenceAdapter implements PersistenceAdapter, JournalEve
     private final ConcurrentHashMap<ActiveMQTopic, JournalTopicMessageStore> topics
= new ConcurrentHashMap<ActiveMQTopic, JournalTopicMessageStore>();
 
     private SystemUsage usageManager;
-    private final long checkpointInterval = 1000 * 60 * 5;
+    private long checkpointInterval = 1000 * 60 * 5;
     private long lastCheckpointRequest = System.currentTimeMillis();
     private long lastCleanup = System.currentTimeMillis();
     private int maxCheckpointWorkers = 10;
@@ -708,6 +708,14 @@ public class JournalPersistenceAdapter implements PersistenceAdapter,
JournalEve
         this.maxCheckpointWorkers = maxCheckpointWorkers;
     }
 
+    public long getCheckpointInterval() {
+        return checkpointInterval;
+    }
+
+    public void setCheckpointInterval(long checkpointInterval) {
+        this.checkpointInterval = checkpointInterval;
+    }
+
     public boolean isUseExternalMessageReferences() {
         return false;
     }
@@ -733,7 +741,7 @@ public class JournalPersistenceAdapter implements PersistenceAdapter,
JournalEve
 
     @Override
     public String toString() {
-        return "JournalPersistenceAdapator(" + longTermPersistence + ")";
+        return "JournalPersistenceAdapter(" + longTermPersistence + ")";
     }
 
     public void setDirectory(File dir) {

http://git-wip-us.apache.org/repos/asf/activemq/blob/d77014aa/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
----------------------------------------------------------------------
diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
index 865e29c..21f69d6 100755
--- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
+++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/journal/JournalPersistenceAdapterFactory.java
@@ -46,6 +46,7 @@ public class JournalPersistenceAdapterFactory extends DataSourceServiceSupport
i
 
     private static final Logger LOG = LoggerFactory.getLogger(JournalPersistenceAdapterFactory.class);
 
+    private long checkpointInterval = 1000 * 60 * 5;
     private int journalLogFileSize = 1024 * 1024 * 20;
     private int journalLogFiles = 2;
     private TaskRunnerFactory taskRunnerFactory;
@@ -66,6 +67,7 @@ public class JournalPersistenceAdapterFactory extends DataSourceServiceSupport
i
         }
         JournalPersistenceAdapter result =  new JournalPersistenceAdapter(getJournal(), jdbcPersistenceAdapter,
getTaskRunnerFactory());
         result.setDirectory(getDataDirectoryFile());
+        result.setCheckpointInterval(getCheckpointInterval());
         return result;
 
     }
@@ -106,6 +108,14 @@ public class JournalPersistenceAdapterFactory extends DataSourceServiceSupport
i
         return useJournal;
     }
 
+    public long getCheckpointInterval() {
+        return checkpointInterval;
+    }
+
+    public void setCheckpointInterval(long checkpointInterval) {
+        this.checkpointInterval = checkpointInterval;
+    }
+
     /**
      * Enables or disables the use of the journal. The default is to use the
      * journal


Mime
View raw message