private void abortAllQualifiedSlowConsumers() { HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) || getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) { LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().getSlowCount() }); toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } else { LOG.trace("Not yet time to abort consumer {}: slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().slowCount }); } } // Now if any subscriptions made it into the aborts list we can kick them. abortSubscription(toAbort, isAbortConnection()); }
} else if (getMaxSlowCount() > 0) { slowConsumers.get(subscriber).slow();
private void abortAllQualifiedSlowConsumers() { HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) || getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) { LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().getSlowCount() }); toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } else { LOG.trace("Not yet time to abort consumer {}: slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().slowCount }); } } // Now if any subscriptions made it into the aborts list we can kick them. abortSubscription(toAbort, isAbortConnection()); }
private void abortAllQualifiedSlowConsumers() { HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) || getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) { LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().getSlowCount() }); toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } else { LOG.trace("Not yet time to abort consumer {}: slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().slowCount }); } } // Now if any subscriptions made it into the aborts list we can kick them. abortSubscription(toAbort, isAbortConnection()); }
private void abortAllQualifiedSlowConsumers() { HashMap<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); for (Entry<Subscription, SlowConsumerEntry> entry : slowConsumers.entrySet()) { if (getMaxSlowDuration() > 0 && (entry.getValue().markCount * getCheckPeriod() >= getMaxSlowDuration()) || getMaxSlowCount() > 0 && entry.getValue().slowCount >= getMaxSlowCount()) { LOG.trace("Transferring consumer{} to the abort list: {} slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().getSlowCount() }); toAbort.put(entry.getKey(), entry.getValue()); slowConsumers.remove(entry.getKey()); } else { LOG.trace("Not yet time to abort consumer {}: slow duration = {}, slow count = {}", new Object[]{ entry.getKey().getConsumerInfo().getConsumerId(), entry.getValue().markCount * getCheckPeriod(), entry.getValue().slowCount }); } } // Now if any subscriptions made it into the aborts list we can kick them. abortSubscription(toAbort, isAbortConnection()); }
} else if (getMaxSlowCount() > 0) { slowConsumers.get(subscriber).slow();
} else if (getMaxSlowCount() > 0) { slowConsumers.get(subscriber).slow();
} else if (getMaxSlowCount() > 0) { slowConsumers.get(subscriber).slow();