/** * {@inheritDoc} */ @Override @SuppressWarnings("unchecked") protected Collection<Future<Void>> processData(DefaultData defaultData) { E timerData = (E) defaultData; long alteredTimestamp = getAlteredTimestamp(timerData); int cacheHash = getCacheHash(timerData, alteredTimestamp); IAggregatedData<E> aggData = map.get(cacheHash); if (null == aggData) { aggData = clone(timerData, alteredTimestamp); IAggregatedData<E> insertedData = map.putIfAbsent(cacheHash, aggData); // if put happened null will be returned if (null == insertedData) { queue.add(aggData); int count = elementCount.incrementAndGet(); if (maxElements < count) { this.writeOldest(); } } else { aggData = insertedData; } } dataAggregator.aggregate(aggData, timerData); return Collections.emptyList(); }