@Override public boolean isSlowConsumer() { return subscription.isSlowConsumer(); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
protected boolean isOptimizeStorage(){ boolean result = false; if (isDoOptimzeMessageStorage()){ consumersLock.readLock().lock(); try{ if (consumers.isEmpty()==false){ result = true; for (Subscription s : consumers) { if (s.getPrefetchSize()==0){ result = false; break; } if (s.isSlowConsumer()){ result = false; break; } if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ result = false; break; } } } } finally { consumersLock.readLock().unlock(); } } return result; } }
if (!entry.getKey().isSlowConsumer()) { subscribersDestroyed.add(entry.getKey());
@Override public boolean isSlowConsumer() { return subscription.isSlowConsumer(); }
@Override public boolean isSlowConsumer() { return subscription.isSlowConsumer(); }
@Override public boolean isSlowConsumer() { return subscription.isSlowConsumer(); }
public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod > maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount > maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
protected boolean isOptimizeStorage(){ boolean result = false; if (isDoOptimzeMessageStorage()){ consumersLock.readLock().lock(); try{ if (consumers.isEmpty()==false){ result = true; for (Subscription s : consumers) { if (s.getPrefetchSize()==0){ result = false; break; } if (s.isSlowConsumer()){ result = false; break; } if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ result = false; break; } } } } finally { consumersLock.readLock().unlock(); } } return result; } }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
@Override public void run() { if (maxSlowDuration > 0) { // mark for (SlowConsumerEntry entry : slowConsumers.values()) { entry.mark(); } } HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { Subscription subscription = entry.getKey(); if (isIgnoreNetworkSubscriptions() && subscription.getConsumerInfo().isNetworkSubscription()) { if (slowConsumers.remove(subscription) != null) { LOG.info("network sub: {} is no longer slow", subscription.getConsumerInfo().getConsumerId()); } continue; } if (entry.getKey().isSlowConsumer()) { if (maxSlowDuration > 0 && (entry.getValue().markCount * checkPeriod >= maxSlowDuration) || maxSlowCount > 0 && entry.getValue().slowCount >= maxSlowCount) { toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } } else { LOG.info("sub: " + entry.getKey().getConsumerInfo().getConsumerId() + " is no longer slow"); slowConsumers.remove(entry.getKey()); } } abortSubscription(toAbort, abortConnection); }
protected boolean isOptimizeStorage(){ boolean result = false; if (isDoOptimzeMessageStorage()){ consumersLock.readLock().lock(); try{ if (consumers.isEmpty()==false){ result = true; for (Subscription s : consumers) { if (s.getPrefetchSize()==0){ result = false; break; } if (s.isSlowConsumer()){ result = false; break; } if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ result = false; break; } } } } finally { consumersLock.readLock().unlock(); } } return result; } }
protected boolean isOptimizeStorage(){ boolean result = false; if (isDoOptimzeMessageStorage()){ consumersLock.readLock().lock(); try{ if (consumers.isEmpty()==false){ result = true; for (Subscription s : consumers) { if (s.getPrefetchSize()==0){ result = false; break; } if (s.isSlowConsumer()){ result = false; break; } if (s.getInFlightUsage() > getOptimizeMessageStoreInFlightLimit()){ result = false; break; } } } } finally { consumersLock.readLock().unlock(); } } return result; } }