Author: borges
Date: 2011-09-21 09:13:36 -0400 (Wed, 21 Sep 2011)
New Revision: 11381
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
Log:
HORNETQ-720 Fix PagingOrderTest.testPageCounter() (fails if the locks are present)
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java
===================================================================
---
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-09-21
09:52:24 UTC (rev 11380)
+++
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/paging/impl/PagingStoreImpl.java 2011-09-21
13:13:36 UTC (rev 11381)
@@ -577,10 +577,7 @@
public Page createPage(final int pageNumber) throws Exception
{
- lock(-1);
- try
- {
- String fileName = createFileName(pageNumber);
+ String fileName = createFileName(pageNumber);
if (fileFactory == null)
{
@@ -599,12 +596,6 @@
file.close();
return page;
- }
-
- finally
- {
- unlock();
- }
}
public void forceAnotherPage() throws Exception
@@ -613,13 +604,15 @@
}
/**
- * It returns a Page out of the Page System without reading it.
- * The method calling this method will remove the page and will start reading it
outside of any locks.
- * This method could also replace the current file by a new file, and that process is
done through acquiring a writeLock on currentPageLock
- *
- * Observation: This method is used internally as part of the regular depage process,
but externally is used only on tests,
- * and that's why this method is part of the Testable Interface
- * */
+ * Returns a Page out of the Page System without reading it.
+ * <p>
+ * The method calling this method will remove the page and will start reading it
outside of any
+ * locks. This method could also replace the current file by a new file, and that
process is done
+ * through acquiring a writeLock on currentPageLock.
+ * <p>
+ * Observation: This method is used internally as part of the regular depage process,
but
+ * externally is used only on tests, and that's why this method is part of the
Testable Interface
+ */
public Page depage() throws Exception
{
lock.writeLock().lock(); // Make sure no checks are done on currentPage while we
are depaging