Author: borges
Date: 2011-09-07 12:09:20 -0400 (Wed, 07 Sep 2011)
New Revision: 11302
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
Log:
HORNETQ-720 Replicate the deletion of large messages.
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
---
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-09-07
16:08:41 UTC (rev 11301)
+++
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2011-09-07
16:09:20 UTC (rev 11302)
@@ -464,7 +464,7 @@
PagingStore store = pagingManager.getPageStore(storeName);
List<Integer> ids = new ArrayList<Integer>();
info.put(storeName, store.getCurrentIds());
- // XXX perhaps before? unnecessary?
+ // HORNETQ-720 XXX perhaps before? unnecessary?
store.forceAnotherPage();
}
replicator.sendPagingInfo(info);
@@ -2118,15 +2118,30 @@
// Package protected ---------------------------------------------
// This should be accessed from this package only
- void deleteFile(final SequentialFile file)
+ void deleteLargeMessageFile(final LargeServerMessage largeServerMessageImpl) throws
HornetQException
{
+ final SequentialFile file = largeServerMessageImpl.getFile();
+ if (file == null)
+ return;
Runnable deleteAction = new Runnable()
{
public void run()
{
try
{
- file.delete();
+ readLock();
+ try
+ {
+ if (replicator != null)
+ {
+
replicator.largeMessageDelete(largeServerMessageImpl.getMessageID());
+ }
+ file.delete();
+ }
+ finally
+ {
+ readUnLock();
+ }
}
catch (Exception e)
{
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java
===================================================================
---
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-09-07
16:08:41 UTC (rev 11301)
+++
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/persistence/impl/journal/LargeServerMessageImpl.java 2011-09-07
16:09:20 UTC (rev 11302)
@@ -226,7 +226,7 @@
{
validateFile();
releaseResources();
- storageManager.deleteFile(file);
+ storageManager.deleteLargeMessageFile(this);
}
public boolean isFileExists() throws Exception