// from is non-inclusive public List<AggregateIntervalCollector> getOrderedIntervalCollectorsInRange(long from, long to) { List<AggregateIntervalCollector> intervalCollectors = Lists.newArrayList(); for (AggregateIntervalCollector intervalCollector : getOrderedAllIntervalCollectors()) { long captureTime = intervalCollector.getCaptureTime(); if (captureTime > from && captureTime <= to) { intervalCollectors.add(intervalCollector); } } return intervalCollectors; }
@Override public void run() { // this synchronized block is to ensure visibility of updates to this particular // activeIntervalCollector synchronized (intervalCollector) { try { intervalCollector.flush(collector); } catch (Throwable t) { // log and terminate successfully logger.error(t.getMessage(), t); } finally { pendingIntervalCollectors.remove(intervalCollector); } } }
public void clearAll() { activeIntervalCollector.clear(); pendingIntervalCollectors.clear(); }