public boolean isEmpty() { synchronized (hydrantLock) { return hydrants.size() == 1 && currHydrant.getIndex().isEmpty(); } }
@Nullable public DateTime getMinTime() { return isEmpty() ? null : DateTimes.utc(getMinTimeMillis()); }
@Nullable public DateTime getMaxTime() { return isEmpty() ? null : DateTimes.utc(getMaxTimeMillis()); }
public Interval getInterval() { DateTime min = DateTimes.utc(minTimestamp); return new Interval(min, isEmpty() ? min : gran.increment(DateTimes.utc(getMaxTimeMillis()))); }
@Override public Sequence<Cursor> makeCursors( @Nullable final Filter filter, final Interval interval, final VirtualColumns virtualColumns, final Granularity gran, final boolean descending, @Nullable QueryMetrics<?> queryMetrics ) { if (index.isEmpty()) { return Sequences.empty(); } final Interval dataInterval = new Interval(getMinTime(), gran.bucketEnd(getMaxTime())); if (!interval.overlaps(dataInterval)) { return Sequences.empty(); } final Interval actualInterval = interval.overlap(dataInterval); Iterable<Interval> intervals = gran.getIterable(actualInterval); if (descending) { intervals = Lists.reverse(ImmutableList.copyOf(intervals)); } return Sequences .simple(intervals) .map(i -> new IncrementalIndexCursor(virtualColumns, descending, filter, i, actualInterval, gran)); }
) throws IOException if (index.isEmpty()) { throw new IAE("Trying to persist an empty index!");
if (index.isEmpty()) { throw new IAE("If you try to persist empty indexes you are going to have a bad time"); persist(index, interval, mergedBase, progressIndicator); } else { if (!index.isEmpty()) { final File finalFile = new File(baseFlushFile, "final"); persist(index, interval, finalFile, progressIndicator);
public boolean isEmpty() { synchronized (hydrantLock) { return hydrants.size() == 1 && currHydrant.getIndex().isEmpty(); } }
@Nullable public DateTime getMinTime() { return isEmpty() ? null : DateTimes.utc(getMinTimeMillis()); }
@Nullable public DateTime getMaxTime() { return isEmpty() ? null : DateTimes.utc(getMaxTimeMillis()); }
public Interval getInterval() { DateTime min = DateTimes.utc(minTimestamp); return new Interval(min, isEmpty() ? min : gran.increment(DateTimes.utc(getMaxTimeMillis()))); }
@Override public Sequence<Cursor> makeCursors( @Nullable final Filter filter, final Interval interval, final VirtualColumns virtualColumns, final Granularity gran, final boolean descending, @Nullable QueryMetrics<?> queryMetrics ) { if (index.isEmpty()) { return Sequences.empty(); } final Interval dataInterval = new Interval(getMinTime(), gran.bucketEnd(getMaxTime())); if (!interval.overlaps(dataInterval)) { return Sequences.empty(); } final Interval actualInterval = interval.overlap(dataInterval); Iterable<Interval> intervals = gran.getIterable(actualInterval); if (descending) { intervals = Lists.reverse(ImmutableList.copyOf(intervals)); } return Sequences .simple(intervals) .map(i -> new IncrementalIndexCursor(virtualColumns, descending, filter, i, actualInterval, gran)); }
if (index.isEmpty()) { throw new IAE("If you try to persist empty indexes you are going to have a bad time"); persist(index, interval, mergedBase, progressIndicator); } else { if (!index.isEmpty()) { final File finalFile = new File(baseFlushFile, "final"); persist(index, interval, finalFile, progressIndicator);
) throws IOException if (index.isEmpty()) { throw new IAE("Trying to persist an empty index!");