public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { if (sub != null) { SlowConsumerEntry entry = slowConsumers.remove(sub); if (entry != null) { Map<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); toAbort.put(sub, entry); abortSubscription(toAbort, abortSubscriberConnection); } else { LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); } } }
@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); }
public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { if (sub != null) { SlowConsumerEntry entry = slowConsumers.remove(sub); if (entry != null) { Map<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); toAbort.put(sub, entry); abortSubscription(toAbort, abortSubscriberConnection); } else { LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); } } }
public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { if (sub != null) { SlowConsumerEntry entry = slowConsumers.remove(sub); if (entry != null) { Map toAbort = new HashMap<Subscription, SlowConsumerEntry>(); toAbort.put(sub, entry); abortSubscription(toAbort, abortSubscriberConnection); } else { LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); } } }
public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { if (sub != null) { SlowConsumerEntry entry = slowConsumers.remove(sub); if (entry != null) { Map<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); toAbort.put(sub, entry); abortSubscription(toAbort, abortSubscriberConnection); } else { LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); } } }
public void abortConsumer(Subscription sub, boolean abortSubscriberConnection) { if (sub != null) { SlowConsumerEntry entry = slowConsumers.remove(sub); if (entry != null) { Map<Subscription, SlowConsumerEntry> toAbort = new HashMap<Subscription, SlowConsumerEntry>(); toAbort.put(sub, entry); abortSubscription(toAbort, abortSubscriberConnection); } else { LOG.warn("cannot abort subscription as it no longer exists in the map of slow consumers: " + sub); } } }
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); }
@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); }