/** * run through each entry; gc'ing & removing old ones that don't have * a recent failure count (we care about those) * @param absoluteTime age in millis * @return true if there are still entries left */ public synchronized boolean purgeUnusedEntries(long absoluteTime) { boolean active = false; ListIterator<NodeEntry> entries = nodeEntries.listIterator(); while (entries.hasNext()) { NodeEntry entry = entries.next(); if (entry.notUsedSince(absoluteTime) && entry.getFailedRecently() == 0) { entries.remove(); } else { active = true; } } return active; }
/** * run through each entry; gc'ing & removing old ones that don't have * a recent failure count (we care about those) * @param absoluteTime age in millis * @return true if there are still entries left */ public synchronized boolean purgeUnusedEntries(long absoluteTime) { boolean active = false; ListIterator<NodeEntry> entries = nodeEntries.listIterator(); while (entries.hasNext()) { NodeEntry entry = entries.next(); if (entry.notUsedSince(absoluteTime) && entry.getFailedRecently() == 0) { entries.remove(); } else { active = true; } } return active; }