activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r618654 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region: BaseDestination.java Destination.java DestinationFilter.java Queue.java policy/PolicyEntry.java
Date Tue, 05 Feb 2008 14:04:45 GMT
Author: rajdavies
Date: Tue Feb  5 06:04:39 2008
New Revision: 618654

URL: http://svn.apache.org/viewvc?rev=618654&view=rev
Log:
Make maximum page size for queues configurable

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/PolicyEntry.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java?rev=618654&r1=618653&r2=618654&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/BaseDestination.java
Tue Feb  5 06:04:39 2008
@@ -39,6 +39,7 @@
     private int maxProducersToAudit=1024;
     private int maxAuditDepth=1;
     private boolean enableAudit=true;
+    private int maxPageSize=1000;
     protected final DestinationStatistics destinationStatistics = new DestinationStatistics();
     
     /**
@@ -152,7 +153,12 @@
         return destinationStatistics.getConsumers().getCount() != 0 ||
             destinationStatistics.getProducers().getCount() != 0;
     }
-
-
     
+    public int getMaxPageSize() {
+        return maxPageSize;
+    }
+
+    public void setMaxPageSize(int maxPageSize) {
+        this.maxPageSize = maxPageSize;
+    }      
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java?rev=618654&r1=618653&r2=618654&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Destination.java
Tue Feb  5 06:04:39 2008
@@ -84,4 +84,8 @@
     void setEnableAudit(boolean enableAudit);
     
     boolean isActive();   
+    
+    int getMaxPageSize();
+    
+    public void setMaxPageSize(int maxPageSize);
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java?rev=618654&r1=618653&r2=618654&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/DestinationFilter.java
Tue Feb  5 06:04:39 2008
@@ -171,4 +171,12 @@
     public boolean isActive() {
         return next.isActive();
     }
+
+    public int getMaxPageSize() {
+        return next.getMaxPageSize();
+    }
+
+    public void setMaxPageSize(int maxPageSize) {
+        next.setMaxPageSize(maxPageSize);
+    }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=618654&r1=618653&r2=618654&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Tue Feb  5 06:04:39 2008
@@ -70,7 +70,6 @@
  * @version $Revision: 1.28 $
  */
 public class Queue extends BaseDestination implements Task {
-    private static int MAXIMUM_PAGE_SIZE  = 1000;
     private final Log log;
     private final List<Subscription> consumers = new ArrayList<Subscription>(50);
     private PendingMessageCursor messages;
@@ -974,7 +973,7 @@
     }
 
     private List<MessageReference> buildList(boolean force) throws Exception {
-        final int toPageIn = MAXIMUM_PAGE_SIZE - pagedInMessages.size();
+        final int toPageIn = getMaxPageSize() - pagedInMessages.size();
         List<MessageReference> result = null;
         if ((force || !consumers.isEmpty()) && toPageIn > 0) {
             messages.setMaxBatchSize(toPageIn);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/PolicyEntry.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/PolicyEntry.java?rev=618654&r1=618653&r2=618654&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/PolicyEntry.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/PolicyEntry.java
Tue Feb  5 06:04:39 2008
@@ -56,6 +56,7 @@
     private boolean enableAudit=true;
     private boolean producerFlowControl = true;
     private boolean optimizedDispatch=false;
+    private int maxPageSize=1000;
    
     public void configure(Broker broker,Queue queue) {
         if (dispatchPolicy != null) {
@@ -76,6 +77,7 @@
         queue.setEnableAudit(isEnableAudit());
         queue.setMaxAuditDepth(getMaxQueueAuditDepth());
         queue.setMaxProducersToAudit(getMaxProducersToAudit());
+        queue.setMaxPageSize(getMaxPageSize());
     }
 
     public void configure(Topic topic) {
@@ -96,6 +98,7 @@
         topic.setEnableAudit(isEnableAudit());
         topic.setMaxAuditDepth(getMaxAuditDepth());
         topic.setMaxProducersToAudit(getMaxProducersToAudit());
+        topic.setMaxPageSize(getMaxPageSize());
     }
 
     public void configure(Broker broker, SystemUsage memoryManager, TopicSubscription subscription)
{
@@ -349,5 +352,13 @@
     public void setOptimizedDispatch(boolean optimizedDispatch) {
         this.optimizedDispatch = optimizedDispatch;
     }
+    
+    public int getMaxPageSize() {
+        return maxPageSize;
+    }
+
+    public void setMaxPageSize(int maxPageSize) {
+        this.maxPageSize = maxPageSize;
+    }    
 
 }



Mime
View raw message