summaryrefslogtreecommitdiff
path: root/qpid/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-03-20 15:16:13 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-03-20 15:16:13 +0000
commitce7b4ca4077e6463db212d467a848f27fe3b039e (patch)
tree0f1435b4d8183630bd71646bd58473b345cbab3f /qpid/java
parentfa0b0787aa9fb5357737fa7bd85c8327d34ea689 (diff)
downloadqpid-python-ce7b4ca4077e6463db212d467a848f27fe3b039e.tar.gz
QPID-1763 : Fixed slow down due to fs lookup for unloaded message introduced in r748516
Merged from branches/0.5-release : r756506 git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@756518 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
index fceaf75a9e..715dd0c385 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
@@ -84,6 +84,7 @@ public class QueueEntryImpl implements QueueEntry
private static final byte IMMEDIATE_AND_DELIVERED = (byte) (IMMEDIATE | DELIVERED_TO_CONSUMER);
private boolean _persistent;
+ private boolean _hasBeenUnloaded = false;
QueueEntryImpl(SimpleQueueEntryList queueEntryList)
{
@@ -407,11 +408,16 @@ public class QueueEntryImpl implements QueueEntry
try
{
- _backingStore.unload(_message);
-
- if (_log.isDebugEnabled())
+ if (!_hasBeenUnloaded)
{
- _log.debug("Unloaded:" + debugIdentity());
+ _hasBeenUnloaded = true;
+
+ _backingStore.unload(_message);
+
+ if (_log.isDebugEnabled())
+ {
+ _log.debug("Unloaded:" + debugIdentity());
+ }
}
_message = null;
@@ -502,7 +508,7 @@ public class QueueEntryImpl implements QueueEntry
if (state != DELETED_STATE && _stateUpdater.compareAndSet(this, state, DELETED_STATE))
{
_queueEntryList.advanceHead();
- if (_backingStore != null)
+ if (_backingStore != null && _hasBeenUnloaded)
{
_backingStore.delete(_messageId);
}