Repository: qpid-broker-j
Updated Branches:
  refs/heads/7.0.x e65920077 -> 75ca738f8


QPID-8207: [Broker-J] Fix evaluation of flow to disk thresholds for virtual 
hosts

(cherry picked from commit 619d85b2986afaf2d09d05ff0ba3dc0fbb89507f)


Project: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/commit/75ca738f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/tree/75ca738f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-broker-j/diff/75ca738f

Branch: refs/heads/7.0.x
Commit: 75ca738f865036db4bdaa0c6e3ffd98727235b4f
Parents: e659200
Author: Alex Rudyy <[email protected]>
Authored: Fri Jun 8 18:14:27 2018 +0100
Committer: Alex Rudyy <[email protected]>
Committed: Sun Jun 10 23:47:38 2018 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/qpid/server/model/BrokerImpl.java | 5 +++--
 .../org/apache/qpid/server/model/adapter/BrokerImplTest.java   | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/75ca738f/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
----------------------------------------------------------------------
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
index 656f184..8d249c1 100644
--- a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
+++ b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerImpl.java
@@ -590,8 +590,9 @@ public class BrokerImpl extends 
AbstractContainer<BrokerImpl> implements Broker<
             }
             else
             {
-                long queueSizeBasedShare = (_flowToDiskThreshold * 
virtualHostTotalQueueSize) / (2 * totalSize);
-                size = queueSizeBasedShare + (proportionalShare / 2);
+                double fraction = 
((double)virtualHostTotalQueueSize)/((double)totalSize);
+                double queueSizeBasedShare = ((double)_flowToDiskThreshold)/ 
2.0 * fraction;
+                size = (long)(queueSizeBasedShare + 
((double)proportionalShare) / 2.0);
             }
 
             if (LOGGER.isDebugEnabled())

http://git-wip-us.apache.org/repos/asf/qpid-broker-j/blob/75ca738f/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.java
----------------------------------------------------------------------
diff --git 
a/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.java
 
b/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.java
index 9fb2dd9..c883bc6 100644
--- 
a/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.java
+++ 
b/broker-core/src/test/java/org/apache/qpid/server/model/adapter/BrokerImplTest.java
@@ -130,6 +130,12 @@ public class BrokerImplTest extends QpidTestCase
                                flowToDiskThreshold);
     }
 
+    public void testAssignTargetSizesWithHighQueueDepthAndMemoryLimit() throws 
Exception
+    {
+        long flowToDiskThreshold = 3L * 1024 * 1024 * 1024;
+        doAssignTargetSizeTest(new long[] {4L * 1024 * 1024 * 1024, 0, 0 , 0}, 
flowToDiskThreshold);
+    }
+
     public void testNetworkBufferSize()
     {
         Map<String, Object> attributes = new HashMap<>();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to