@Test public void testLowerBoundFunction() { for (long chunkSize = 1; chunkSize < 15; ++chunkSize) { for (int power = 0; power < 8; ++power) { for (int startTime = -50; startTime < 50; ++startTime) { for (int i = -50; i < 50; ++i) { long lowerBound = AggregatingTrimmer.lowerBound(i, startTime, chunkSize, power); Assert.assertTrue("Error occurred for: " + i + " .. lower bound: " + lowerBound + " .. power: " + power + " .. startTime: " + startTime, lowerBound <= i); Assert.assertTrue("Error occurred for: " + i + " .. lower bound: " + lowerBound + " .. power: " + power + " .. startTime: " + startTime, i < lowerBound + chunkSize); } } } } }
private long lowerBound(final Long key) { return lowerBound(key, TimeUnit.NANOSECONDS.convert(startTime, startUnitTime), chunkSize, COLLISION_BUFFER_POWER); }
AggregatingTrimmer implements SlidingWindowTrimmer<Long> { private long lowerBound(final Long key) { return lowerBound(key, TimeUnit.NANOSECONDS.convert(startTime, startUnitTime), chunkSize, COLLISION_BUFFER_POWER); } }
AggregatingTrimmer implements SlidingWindowTrimmer<Long> { private long lowerBound(final Long key) { return lowerBound(key, TimeUnit.NANOSECONDS.convert(startTime, startUnitTime), chunkSize, COLLISION_BUFFER_POWER); } AggregatingTrimmer(final long startTime,
                              final TimeUnit startUnitTime,
                              final long chunkTimeSize,
                              final TimeUnit chunkTimeSizeUnit); }
AggregatingTrimmer implements SlidingWindowTrimmer<Long> { private long lowerBound(final Long key) { return lowerBound(key, TimeUnit.NANOSECONDS.convert(startTime, startUnitTime), chunkSize, COLLISION_BUFFER_POWER); } AggregatingTrimmer(final long startTime,
                              final TimeUnit startUnitTime,
                              final long chunkTimeSize,
                              final TimeUnit chunkTimeSizeUnit); @Override void trim(final ConcurrentNavigableMap<Long, Long> map, final long key); void register(final TimeReservoir<AggregatedValueObject> timeReservoirListener); @Override void setTimeReservoir(final TimeReservoir<Long> timeReservoirNotifier); TimeReservoir<Long> getTimeReservoirNotifier(); }
AggregatingTrimmer implements SlidingWindowTrimmer<Long> { private long lowerBound(final Long key) { return lowerBound(key, TimeUnit.NANOSECONDS.convert(startTime, startUnitTime), chunkSize, COLLISION_BUFFER_POWER); } AggregatingTrimmer(final long startTime,
                              final TimeUnit startUnitTime,
                              final long chunkTimeSize,
                              final TimeUnit chunkTimeSizeUnit); @Override void trim(final ConcurrentNavigableMap<Long, Long> map, final long key); void register(final TimeReservoir<AggregatedValueObject> timeReservoirListener); @Override void setTimeReservoir(final TimeReservoir<Long> timeReservoirNotifier); TimeReservoir<Long> getTimeReservoirNotifier();  }