activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1134732 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Date Sat, 11 Jun 2011 19:29:55 GMT
Author: chirino
Date: Sat Jun 11 19:29:54 2011
New Revision: 1134732

URL: http://svn.apache.org/viewvc?rev=1134732&view=rev
Log:
Further work to support https://issues.apache.org/jira/browse/APLO-39 : Properly adjust the
queue's swapped_in_size_max settings when the queue buffer size configuration setting changes.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1134732&r1=1134731&r2=1134732&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
(original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Sat Jun 11 19:29:54 2011
@@ -179,10 +179,14 @@ class Queue(val router: LocalRouter, val
   var restored_from_store = false
 
   def update(on_completed:Runnable) = dispatch_queue {
-    val was_persistent = tune_persistent
-    val prev_size = tune_consumer_buffer
+
+    val prev_persistent = tune_persistent
+    val prev_consumer_size = tune_consumer_buffer
+    val prev_queue_buffer = tune_queue_buffer
+
     configure(binding.config(virtual_host))
-    val consumer_buffer_change = tune_consumer_buffer-prev_size
+
+    val consumer_buffer_change = tune_consumer_buffer-prev_consumer_size
     if( consumer_buffer_change!=0 ) {
       // for each
       all_subscriptions.values.foreach { sub =>
@@ -193,7 +197,11 @@ class Queue(val router: LocalRouter, val
         }
       }
     }
+
+    swapped_in_size_max += (tune_queue_buffer-prev_queue_buffer)
+
     restore_from_store {
+      trigger_swap
       on_completed.run
     }
   }
@@ -229,7 +237,7 @@ class Queue(val router: LocalRouter, val
 
   protected def _start(on_completed: Runnable) = {
 
-    swapped_in_size_max = tune_queue_buffer;
+    swapped_in_size_max += tune_queue_buffer;
 
     restore_from_store {
 
@@ -257,6 +265,10 @@ class Queue(val router: LocalRouter, val
     all_subscriptions.values.toArray.foreach { sub:Subscription =>
       sub.close()
     }
+
+    swapped_in_size_max -= tune_queue_buffer;
+    trigger_swap
+
     on_completed.run
   }
 



Mime
View raw message