Author: timfox
Date: 2009-11-03 04:23:31 -0500 (Tue, 03 Nov 2009)
New Revision: 8191
Modified:
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalLargeServerMessage.java
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
Log:
fixed bug in large messages
Modified:
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalLargeServerMessage.java
===================================================================
---
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalLargeServerMessage.java 2009-11-03
08:48:47 UTC (rev 8190)
+++
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalLargeServerMessage.java 2009-11-03
09:23:31 UTC (rev 8191)
@@ -66,7 +66,7 @@
public JournalLargeServerMessage(final JournalStorageManager storageManager)
{
- this.storageManager = storageManager;
+ this.storageManager = storageManager;
}
/**
@@ -83,7 +83,7 @@
storageManager = copy.storageManager;
file = fileCopy;
bodySize = copy.bodySize;
- setMessageID(newID);
+ setMessageID(newID);
}
// Public --------------------------------------------------------
@@ -259,7 +259,7 @@
public boolean isFileExists() throws Exception
{
- SequentialFile localfile =
storageManager.createFileForLargeMessage(getMessageID());
+ SequentialFile localfile = storageManager.createFileForLargeMessage(getMessageID(),
durable);
return localfile.exists();
}
@@ -305,7 +305,7 @@
idToUse = linkMessage.getMessageID();
}
- SequentialFile newfile = storageManager.createFileForLargeMessage(idToUse);
+ SequentialFile newfile = storageManager.createFileForLargeMessage(idToUse,
durable);
ServerMessage newMessage = new JournalLargeServerMessage(linkMessage == null ?
this
:
(JournalLargeServerMessage)linkMessage,
@@ -341,9 +341,9 @@
{
throw new RuntimeException("MessageID not set on LargeMessage");
}
+
+ file = storageManager.createFileForLargeMessage(getMessageID(), durable);
- file = storageManager.createFileForLargeMessage(getMessageID());
-
file.open();
bodySize = file.size();
@@ -364,7 +364,7 @@
this.linkMessage = message;
- file = storageManager.createFileForLargeMessage(message.getMessageID());
+ file = storageManager.createFileForLargeMessage(message.getMessageID(), durable);
try
{
file.open();
Modified:
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
---
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2009-11-03
08:48:47 UTC (rev 8190)
+++
trunk/src/main/org/hornetq/core/persistence/impl/journal/JournalStorageManager.java 2009-11-03
09:23:31 UTC (rev 8191)
@@ -946,6 +946,7 @@
{
// this could happen if the message was deleted but the file still exists as
the file still being used
originalMessage = createLargeMessage();
+ originalMessage.setDurable(true);
originalMessage.setMessageID(originalMessageID);
messages.put(originalMessageID, originalMessage);
}
@@ -1372,9 +1373,16 @@
* @param messageID
* @return
*/
- SequentialFile createFileForLargeMessage(final long messageID)
+ SequentialFile createFileForLargeMessage(final long messageID, final boolean durable)
{
- return largeMessagesFactory.createSequentialFile(messageID + ".msg", -1);
+ if (durable)
+ {
+ return largeMessagesFactory.createSequentialFile(messageID + ".msg",
-1);
+ }
+ else
+ {
+ return largeMessagesFactory.createSequentialFile(messageID + ".tmp",
-1);
+ }
}
// Private
----------------------------------------------------------------------------------
Show replies by date