activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1032373 - /activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
Date Sun, 07 Nov 2010 19:52:03 GMT
Author: chirino
Date: Sun Nov  7 19:52:03 2010
New Revision: 1032373

URL: http://svn.apache.org/viewvc?rev=1032373&view=rev
Log:
Added option to control min queue capacity and start it off with 32k. Also trigger the message
re-filler in response to capacity expanding.

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=1032373&r1=1032372&r2=1032373&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
Sun Nov  7 19:52:03 2010
@@ -84,6 +84,11 @@ class Queue(val host: VirtualHost, var i
   var tune_producer_buffer = 1024*32
 
   /**
+   *  The amount of memory buffer space for the queue..
+   */
+  var tune_queue_buffer = 1024*32
+
+  /**
    *  The amount of memory buffer space to use per subscription.
    */
   var tune_consumer_buffer = 1024*64
@@ -143,6 +148,8 @@ class Queue(val host: VirtualHost, var i
 
   protected def _start(onCompleted: Runnable) = {
 
+    capacity = tune_queue_buffer;
+
     def completed: Unit = {
       // by the time this is run, consumers and producers may have already joined.
       onCompleted.run
@@ -210,7 +217,11 @@ class Queue(val host: VirtualHost, var i
   }
 
   def addCapacity(amount:Int) = {
+    val was_full = messages.full
     capacity += amount
+    if( was_full && !messages.full ) {
+      messages.refiller.run
+    }
   }
 
   object messages extends Sink[Delivery] {



Mime
View raw message