activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject git commit: https://issues.apache.org/jira/browse/AMQ-5166
Date Tue, 06 May 2014 20:31:43 GMT
Repository: activemq
Updated Branches:
  refs/heads/trunk 810ce35f5 -> bfb177821


https://issues.apache.org/jira/browse/AMQ-5166

Apply fix for tracker settings.

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

Branch: refs/heads/trunk
Commit: bfb1778211f573700d07261a0601b4f17c7916a4
Parents: 810ce35
Author: Timothy Bish <tabish121@gmai.com>
Authored: Tue May 6 16:31:27 2014 -0400
Committer: Timothy Bish <tabish121@gmai.com>
Committed: Tue May 6 16:31:27 2014 -0400

----------------------------------------------------------------------
 .../activemq/store/kahadb/MessageDatabase.java     | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/bfb17782/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 df970d4..755f214 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
@@ -204,7 +204,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
     class MetadataMarshaller extends VariableMarshaller<Metadata> {
         @Override
         public Metadata readPayload(DataInput dataIn) throws IOException {
-            Metadata rc = new Metadata();
+            Metadata rc = createMetadata();
             rc.read(dataIn);
             return rc;
         }
@@ -392,7 +392,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
                 } else {
                     pageFile.delete();
                 }
-                metadata = new Metadata();
+                metadata = createMetadata();
                 pageFile = null;
                 loadPageFile();
             }
@@ -430,7 +430,7 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
                     checkpointUpdate(true);
                 }
                 pageFile.unload();
-                metadata = new Metadata();
+                metadata = createMetadata();
             } finally {
                 checkpointLock.writeLock().unlock();
             }
@@ -687,7 +687,11 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
             KahaProducerAuditCommand audit = (KahaProducerAuditCommand) load(metadata.producerSequenceIdTrackerLocation);
             try {
                 ObjectInputStream objectIn = new ObjectInputStream(audit.getAudit().newInput());
+                int maxNumProducers = getMaxFailoverProducersToTrack();
+                int maxAuditDepth = getFailoverProducersAuditDepth();
                 metadata.producerSequenceIdTracker = (ActiveMQMessageAuditNoSync) objectIn.readObject();
+                metadata.producerSequenceIdTracker.setAuditDepth(maxAuditDepth);
+                metadata.producerSequenceIdTracker.setMaximumNumberOfProducersToTrack(maxNumProducers);
                 return journal.getNextLocation(metadata.producerSequenceIdTrackerLocation);
             } catch (Exception e) {
                 LOG.warn("Cannot recover message audit", e);
@@ -2458,6 +2462,13 @@ public abstract class MessageDatabase extends ServiceSupport implements
BrokerSe
         return manager;
     }
 
+    private Metadata createMetadata() {
+        Metadata md = new Metadata();
+        md.producerSequenceIdTracker.setAuditDepth(getFailoverProducersAuditDepth());
+        md.producerSequenceIdTracker.setMaximumNumberOfProducersToTrack(getMaxFailoverProducersToTrack());
+        return md;
+    }
+
     public int getJournalMaxWriteBatchSize() {
         return journalMaxWriteBatchSize;
     }


Mime
View raw message