ARTEMIS-678 refactor log for expiry optimization
This commit is contained in:
parent
90e912b0b5
commit
652f8265c8
|
@ -1375,10 +1375,7 @@ public class QueueImpl implements Queue {
|
|||
|
||||
@Override
|
||||
public synchronized boolean expireReference(final long messageID) throws Exception {
|
||||
if (expiryAddress != null && expiryAddress.equals(this.address)) {
|
||||
// check expire with itself would be silly (waste of time)
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Cannot expire from " + address + " into " + expiryAddress);
|
||||
if (isExpirationRedundant()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1400,10 +1397,7 @@ public class QueueImpl implements Queue {
|
|||
|
||||
@Override
|
||||
public synchronized int expireReferences(final Filter filter) throws Exception {
|
||||
if (expiryAddress != null && expiryAddress.equals(this.address)) {
|
||||
// check expire with itself would be silly (waste of time)
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Cannot expire from " + address + " into " + expiryAddress);
|
||||
if (isExpirationRedundant()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1432,10 +1426,7 @@ public class QueueImpl implements Queue {
|
|||
|
||||
@Override
|
||||
public void expireReferences() {
|
||||
if (expiryAddress != null && expiryAddress.equals(this.address)) {
|
||||
// check expire with itself would be silly (waste of time)
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Cannot expire from " + address + " into " + expiryAddress);
|
||||
if (isExpirationRedundant()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1445,6 +1436,18 @@ public class QueueImpl implements Queue {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isExpirationRedundant() {
|
||||
if (expiryAddress != null && expiryAddress.equals(this.address)) {
|
||||
// check expire with itself would be silly (waste of time)
|
||||
if (logger.isTraceEnabled())
|
||||
logger.trace("Redundant expiration from " + address + " to " + expiryAddress);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
class ExpiryScanner implements Runnable {
|
||||
|
||||
public AtomicInteger scannerRunning = new AtomicInteger(0);
|
||||
|
|
Loading…
Reference in New Issue