[hornetq-commits] JBoss hornetq SVN: r11344 - branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Sep 13 10:44:04 EDT 2011


Author: borges
Date: 2011-09-13 10:44:04 -0400 (Tue, 13 Sep 2011)
New Revision: 11344

Modified:
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
   branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
Log:
clean up of locking and scheduled threads

Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2011-09-13 14:43:29 UTC (rev 11343)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2011-09-13 14:44:04 UTC (rev 11344)
@@ -238,6 +238,11 @@
    {
       for (PageSubscription cursor : activeCursors.values())
       {
+         cursor.disableAutoCleanup();
+      }
+
+      for (PageSubscription cursor : activeCursors.values())
+      {
          cursor.stop();
       }
 
@@ -247,7 +252,7 @@
 
       while (!future.await(10000))
       {
-         log.warn("Waiting cursor provider " + this + " to finish executors");
+         log.warn("Waiting cursor provider " + this + " to finish executors" + executor);
       }
 
    }
@@ -265,7 +270,7 @@
 
       while (!future.await(10000))
       {
-         log.warn("Waiting cursor provider " + this + " to finish executors");
+         log.warn("Waiting cursor provider " + this + " to finish executors " + executor);
       }
 
    }
@@ -463,7 +468,7 @@
     * @param currentPage
     * @throws Exception
     */
-   protected void storePositions(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
+   private void storePositions(ArrayList<PageSubscription> cursorList, Page currentPage) throws Exception
    {
       try
       {
@@ -500,8 +505,7 @@
 
    // Protected -----------------------------------------------------
 
-   /* Protected as we may let test cases to instrument the test */
-   protected PageCacheImpl createPageCache(final long pageId) throws Exception
+   private PageCacheImpl createPageCache(final long pageId) throws Exception
    {
       return new PageCacheImpl(pagingStore.createPage((int)pageId));
    }

Modified: branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2011-09-13 14:43:29 UTC (rev 11343)
+++ branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2011-09-13 14:44:04 UTC (rev 11344)
@@ -59,8 +59,6 @@
  *
  * A page cursor will always store its
  * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- *
  */
 class PageSubscriptionImpl implements PageSubscription
 {
@@ -161,11 +159,6 @@
       autoCleanup = true;
    }
 
-   public PageCursorProvider getProvider()
-   {
-      return cursorProvider;
-   }
-
    public void bookmark(PagePosition position) throws Exception
    {
       PageCursorInfo cursorInfo = getPageInfo(position);
@@ -206,6 +199,12 @@
                   PageSubscriptionImpl.log.warn("Error on cleaning up cursor pages", e);
                }
             }
+
+            @Override
+            public String toString()
+            {
+               return "PageSubscription.scheduleCleanupCheck()";
+            }
          });
       }
    }
@@ -215,6 +214,8 @@
     * */
    public void cleanupEntries() throws Exception
    {
+      if (!autoCleanup)
+         return;
       Transaction tx = new TransactionImpl(store);
 
       boolean persist = false;
@@ -664,7 +665,7 @@
       executor.execute(future);
       while (!future.await(1000))
       {
-         PageSubscriptionImpl.log.warn("Waiting page cursor to finish executors - " + this);
+         PageSubscriptionImpl.log.warn("Waiting page cursor to finish executors - " + this + "\n" + executor);
       }
    }
 



More information about the hornetq-commits mailing list