cleanup interval determination in II

This commit is contained in:
fjy 2013-05-20 21:06:32 -07:00
parent e404442ad4
commit 69c7131a7b
1 changed files with 3 additions and 5 deletions

View File

@ -119,13 +119,11 @@ public class IncrementalIndexStorageAdapter implements StorageAdapter
public Iterable<Cursor> makeCursors(final Filter filter, final Interval interval, final QueryGranularity gran) public Iterable<Cursor> makeCursors(final Filter filter, final Interval interval, final QueryGranularity gran)
{ {
Interval actualIntervalTmp = interval; Interval actualIntervalTmp = interval;
final Interval indexInterval = getInterval();
if (!actualIntervalTmp.overlaps(indexInterval)) {
return ImmutableList.of();
}
final Interval dataInterval = new Interval(getMinTime().getMillis(), gran.next(getMaxTime().getMillis())); final Interval dataInterval = new Interval(getMinTime().getMillis(), gran.next(getMaxTime().getMillis()));
if (!actualIntervalTmp.overlaps(dataInterval)) {
return ImmutableList.of();
}
if (actualIntervalTmp.getStart().isBefore(dataInterval.getStart())) { if (actualIntervalTmp.getStart().isBefore(dataInterval.getStart())) {
actualIntervalTmp = actualIntervalTmp.withStart(dataInterval.getStart()); actualIntervalTmp = actualIntervalTmp.withStart(dataInterval.getStart());