You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/03/20 16:04:02 UTC
svn commit: r756506 -
/qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
Author: ritchiem
Date: Fri Mar 20 15:04:01 2009
New Revision: 756506
URL: http://svn.apache.org/viewvc?rev=756506&view=rev
Log:
QPID-1763 : Fixed slow down due to fs lookup for unloaded message introduced in r748516
Modified:
qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
Modified: qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java?rev=756506&r1=756505&r2=756506&view=diff
==============================================================================
--- qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java (original)
+++ qpid/branches/0.5-release/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java Fri Mar 20 15:04:01 2009
@@ -84,6 +84,7 @@
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 @@
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 @@
if (state != DELETED_STATE && _stateUpdater.compareAndSet(this, state, DELETED_STATE))
{
_queueEntryList.advanceHead();
- if (_backingStore != null)
+ if (_backingStore != null && _hasBeenUnloaded)
{
_backingStore.delete(_messageId);
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org