You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by lq...@apache.org on 2015/10/22 13:12:28 UTC

svn commit: r1709987 - /qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java

Author: lquack
Date: Thu Oct 22 11:12:27 2015
New Revision: 1709987

URL: http://svn.apache.org/viewvc?rev=1709987&view=rev
Log:
QPID-6775: [Java Broker] Avoid immediate reload of metadata after flow to disk.

Be flowing to disk after enqueuing we avoid the reload of the metadata that
occurs on calling isPersistent() in the queueEntry creation.
This is an improvement but might not fully address the problem but the memory
impact of putting a persistent flag into ServerMessages is considered to
intrusive at this point in the release cycle.

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java?rev=1709987&r1=1709986&r2=1709987&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java Thu Oct 22 11:12:27 2015
@@ -1067,10 +1067,6 @@ public abstract class AbstractQueue<X ex
         incrementQueueCount();
         incrementQueueSize(message);
 
-        long estimatedQueueSize = _atomicQueueSize.get() + _atomicQueueCount.get() * _estimatedAverageMessageHeaderSize;
-        _flowToDiskChecker.flowToDiskAndReportIfNecessary(message.getStoredMessage(), estimatedQueueSize,
-                                                          _targetQueueSize.get());
-
         _totalMessagesReceived.incrementAndGet();
 
         if(_recovering.get() != RECOVERED)
@@ -1104,6 +1100,9 @@ public abstract class AbstractQueue<X ex
             doEnqueue(message, action, enqueueRecord);
         }
 
+        long estimatedQueueSize = _atomicQueueSize.get() + _atomicQueueCount.get() * _estimatedAverageMessageHeaderSize;
+        _flowToDiskChecker.flowToDiskAndReportIfNecessary(message.getStoredMessage(), estimatedQueueSize,
+                                                          _targetQueueSize.get());
     }
 
     public final void recover(ServerMessage message, final MessageEnqueueRecord enqueueRecord)



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org