activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r615341 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq: broker/region/Queue.java broker/region/cursors/QueueStorePrefetch.java store/amq/AMQMessageStore.java
Date Fri, 25 Jan 2008 21:06:44 GMT
Author: rajdavies
Date: Fri Jan 25 13:06:43 2008
New Revision: 615341

URL: http://svn.apache.org/viewvc?rev=615341&view=rev
Log:
disable caching of messages for the Queue Cursor

Modified:
    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/cursors/QueueStorePrefetch.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java

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=615341&r1=615340&r2=615341&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
Fri Jan 25 13:06:43 2008
@@ -874,15 +874,16 @@
      */
     public boolean iterate() {
 
-        while (!messagesWaitingForSpace.isEmpty() &&!memoryUsage.isFull()) {
-            Runnable op = messagesWaitingForSpace.removeFirst();
-            op.run();
-        }
         try {
             pageInMessages(false);
         } catch (Exception e) {
             log.error("Failed to page in more queue messages ", e);
         }
+        while (!messagesWaitingForSpace.isEmpty() &&!memoryUsage.isFull()) {
+            Runnable op = messagesWaitingForSpace.removeFirst();
+            op.run();
+        }
+        
         return false;
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java?rev=615341&r1=615340&r2=615341&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/QueueStorePrefetch.java
Fri Jan 25 13:06:43 2008
@@ -109,7 +109,7 @@
 
     public synchronized void remove() {
         size--;
-        if (size==0 && isStarted()) {
+        if (size==0 && isStarted() && cacheEnabled) {
             cacheEnabled=true;
         }
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java?rev=615341&r1=615340&r2=615341&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/amq/AMQMessageStore.java
Fri Jan 25 13:06:43 2008
@@ -483,7 +483,7 @@
     }
 
     public void recoverNextMessages(int maxReturned, MessageRecoveryListener listener) throws
Exception {
-        
+        /*
           RecoveryListenerAdapter recoveryListener = new RecoveryListenerAdapter(
                 this, listener);
         if (referenceStore.supportsExternalBatchControl()) {
@@ -510,14 +510,14 @@
             flush();
             referenceStore.recoverNextMessages(maxReturned, recoveryListener);
         }
-         /*
+        */
         RecoveryListenerAdapter recoveryListener = new RecoveryListenerAdapter(this, listener);
         referenceStore.recoverNextMessages(maxReturned, recoveryListener);
         if (recoveryListener.size() == 0 && recoveryListener.hasSpace()) {
             flush();
             referenceStore.recoverNextMessages(maxReturned, recoveryListener);
         }
-        */
+       
     }
 
     Message getMessage(ReferenceData data) throws IOException {



Mime
View raw message