activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [1/6] activemq-artemis git commit: ARTEMIS-1029 Fixing Paging issues
Date Fri, 10 Mar 2017 03:20:14 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master ed1d4c094 -> c1c0354d9


ARTEMIS-1029 Fixing Paging issues

- Browser out of order
- PageStore not being cleared


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/b73828a0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/b73828a0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/b73828a0

Branch: refs/heads/master
Commit: b73828a0f4be333a0b9a6552db3778f4224f0089
Parents: 761f422
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Mar 9 21:44:12 2017 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Mar 9 22:12:58 2017 -0500

----------------------------------------------------------------------
 .../artemis/core/server/impl/ActiveMQServerImpl.java    |  1 +
 .../activemq/artemis/core/server/impl/QueueImpl.java    | 12 ++++++++++--
 .../tests/integration/client/TemporaryQueueTest.java    |  3 ++-
 3 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b73828a0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 2b5ecaf..c31a323 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2420,6 +2420,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
       long txID = storageManager.generateID();
       storageManager.deleteAddressBinding(txID, addressInfo.getId());
       storageManager.commitBindings(txID);
+      pagingManager.deletePageStore(address);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b73828a0/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
index 44c5ba4..e04cf47 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
@@ -49,6 +49,7 @@ import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.api.core.management.ManagementHelper;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.io.IOCallback;
+import org.apache.activemq.artemis.core.paging.cursor.PagePosition;
 import org.apache.activemq.artemis.core.paging.cursor.PageSubscription;
 import org.apache.activemq.artemis.core.paging.cursor.PagedReference;
 import org.apache.activemq.artemis.core.persistence.QueueStatus;
@@ -2968,6 +2969,7 @@ public class QueueImpl implements Queue {
       Iterator lastIterator = null;
 
       MessageReference cachedNext = null;
+      HashSet<PagePosition> previouslyBrowsed = new HashSet();
 
       private QueueBrowserIterator() {
          messagesIterator = new SynchronizedIterator(messageReferences.iterator());
@@ -3003,15 +3005,21 @@ public class QueueImpl implements Queue {
          while (true) {
             if (messagesIterator != null && messagesIterator.hasNext()) {
                MessageReference msg = messagesIterator.next();
+               if (msg.isPaged()) {
+                  previouslyBrowsed.add(((PagedReference)msg).getPosition());
+               }
                return msg;
             } else {
                break;
             }
          }
          if (getPagingIterator() != null) {
-            if (getPagingIterator().hasNext()) {
+            while (getPagingIterator().hasNext()) {
                lastIterator = getPagingIterator();
-               MessageReference ref = getPagingIterator().next();
+               PagedReference ref = getPagingIterator().next();
+               if (previouslyBrowsed.contains(ref.getPosition())) {
+                  continue;
+               }
                return ref;
             }
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b73828a0/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
index 5be1638..86b194e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java
@@ -135,12 +135,13 @@ public class TemporaryQueueTest extends SingleServerTestBase {
       assertTrue(Arrays.asList(storeNames).contains(address));
 
       consumer.close();
+
       session.deleteQueue(queue);
+      session.close();
 
       storeNames = server.getPagingManager().getStoreNames();
       assertFalse(Arrays.asList(storeNames).contains(address));
 
-      session.close();
    }
 
    @Test


Mime
View raw message