Interval ival = e.getKey(); if (curr != null && curr.abuts(ival) && cols.equals(e.getValue())) { curr = curr.withEnd(ival.getEnd()); } else { if (curr != null) {
@Test public void testUnUsedHighRange() throws IOException { coordinator.announceHistoricalSegments(SEGMENTS); unUseSegment(); Assert.assertEquals( SEGMENTS, ImmutableSet.copyOf( coordinator.getUnusedSegmentsForInterval( defaultSegment.getDataSource(), defaultSegment.getInterval().withEnd(defaultSegment.getInterval().getEnd().plus(1)) ) ) ); Assert.assertEquals( SEGMENTS, ImmutableSet.copyOf( coordinator.getUnusedSegmentsForInterval( defaultSegment.getDataSource(), defaultSegment.getInterval().withEnd(defaultSegment.getInterval().getEnd().plusYears(1)) ) ) ); }
@Test public void testUsedWithinBoundsEnd() throws IOException { coordinator.announceHistoricalSegments(SEGMENTS); Assert.assertEquals( SEGMENTS, ImmutableSet.copyOf( coordinator.getUsedSegmentsForInterval( defaultSegment.getDataSource(), defaultSegment.getInterval().withEnd(defaultSegment.getInterval().getEnd().minusMillis(1)) ) ) ); }
@Test public void testUsedOverlapEnd() throws IOException { coordinator.announceHistoricalSegments(SEGMENTS); Assert.assertEquals( SEGMENTS, ImmutableSet.copyOf( coordinator.getUsedSegmentsForInterval( defaultSegment.getDataSource(), defaultSegment.getInterval().withEnd(defaultSegment.getInterval().getEnd().plusMillis(1)) ) ) ); }
public void validateIntervals(List<String> intervals) { this.intervals = Lists.newArrayList(); for (String interval : intervals) { if(StringUtils.isEmpty(interval)) { throw new IllegalArgumentException("Invalid interval format : " + interval); } Interval plusEndInterval; try { Interval parsedInterval = Interval.parse(replaceCurrentTime(interval)); plusEndInterval = parsedInterval.withEnd(parsedInterval.getEnd().plusSeconds(1)); } catch (Exception e) { throw new IllegalArgumentException("Invalid interval format : " + interval); } this.intervals.add(plusEndInterval.toString()); } }
Interval ival = e.getKey(); if (curr != null && curr.abuts(ival) && cols.equals(e.getValue())) { curr = curr.withEnd(ival.getEnd()); } else { if (curr != null) {
Interval ival = e.getKey(); if (curr != null && curr.abuts(ival) && cols.equals(e.getValue())) { curr = curr.withEnd(ival.getEnd()); } else { if (curr != null) {
truncatedInterval = new Interval(now, now); } else { truncatedInterval = interval.withEnd(now);
@Override public Iterable<Cursor> makeCursors(Filter filter, Interval interval, QueryGranularity gran) { Interval actualInterval = interval; final Interval dataInterval = new Interval(getMinTime().getMillis(), gran.next(getMaxTime().getMillis())); if (!actualInterval.overlaps(dataInterval)) { return ImmutableList.of(); } if (actualInterval.getStart().isBefore(dataInterval.getStart())) { actualInterval = actualInterval.withStart(dataInterval.getStart()); } if (actualInterval.getEnd().isAfter(dataInterval.getEnd())) { actualInterval = actualInterval.withEnd(dataInterval.getEnd()); } final Iterable<Cursor> iterable; if (filter == null) { iterable = new NoFilterCursorIterable(index, actualInterval, gran); } else { Offset offset = new ConciseOffset(filter.goConcise(new ColumnSelectorBitmapIndexSelector(index))); iterable = new CursorIterable(index, actualInterval, gran, offset); } return FunctionalIterable.create(iterable).keep(Functions.<Cursor>identity()); }
actualIntervalTmp = actualIntervalTmp.withEnd(dataInterval.getEnd());