@JsonCreator public MultipleIntervalSegmentSpec( @JsonProperty("intervals") List<Interval> intervals ) { this.intervals = Collections.unmodifiableList(JodaUtils.condenseIntervals(intervals)); }
@Override public List<Interval> getIntervals() { if (intervals != null) { return intervals; } intervals = JodaUtils.condenseIntervals( Iterables.transform( descriptors, new Function<SegmentDescriptor, Interval>() { @Override public Interval apply(SegmentDescriptor input) { return input.getInterval(); } } ) ); return intervals; }
@JsonCreator public SegmentListUsedAction( @JsonProperty("dataSource") String dataSource, @Deprecated @JsonProperty("interval") Interval interval, @JsonProperty("intervals") List<Interval> intervals ) { this.dataSource = dataSource; Preconditions.checkArgument( interval == null || intervals == null, "please specify intervals only" ); List<Interval> theIntervals = null; if (interval != null) { theIntervals = ImmutableList.of(interval); } else if (intervals != null && intervals.size() > 0) { theIntervals = JodaUtils.condenseIntervals(intervals); } this.intervals = Preconditions.checkNotNull(theIntervals, "no intervals found"); }
public Optional<List<Interval>> getIntervals() { Optional<SortedSet<Interval>> setOptional = schema.getDataSchema().getGranularitySpec().bucketIntervals(); if (setOptional.isPresent()) { return Optional.of((List<Interval>) JodaUtils.condenseIntervals(setOptional.get())); } else { return Optional.absent(); } }
@JsonCreator public IntervalDimFilter( @JsonProperty("dimension") String dimension, @JsonProperty("intervals") List<Interval> intervals, @JsonProperty("extractionFn") ExtractionFn extractionFn ) { Preconditions.checkNotNull(dimension, "dimension can not be null"); Preconditions.checkNotNull(intervals, "intervals can not be null"); Preconditions.checkArgument(intervals.size() > 0, "must specify at least one interval"); this.dimension = dimension; this.intervals = Collections.unmodifiableList(JodaUtils.condenseIntervals(intervals)); this.extractionFn = extractionFn; this.intervalLongs = makeIntervalLongs(); this.convertedFilter = new OrDimFilter(makeBoundDimFilters()); }
@GET @Path("/{dataSourceName}/candidates") @Produces(MediaType.APPLICATION_JSON) @ResourceFilters(DatasourceResourceFilter.class) public Iterable<LocatedSegmentDescriptor> getQueryTargets( @PathParam("dataSourceName") String datasource, @QueryParam("intervals") String intervals, @QueryParam("numCandidates") @DefaultValue("-1") int numCandidates, @Context final HttpServletRequest req ) throws IOException { List<Interval> intervalList = Lists.newArrayList(); for (String interval : intervals.split(",")) { intervalList.add(Intervals.of(interval.trim())); } List<Interval> condensed = JodaUtils.condenseIntervals(intervalList); return ServerViewUtil.getTargetLocations(timelineServerView, datasource, condensed, numCandidates); }
theIntervals = ImmutableList.of(interval); } else if (intervals != null && intervals.size() > 0) { theIntervals = JodaUtils.condenseIntervals(intervals);
final List<Interval> intervals = JodaUtils.condenseIntervals( Iterables.transform(entry.getValue(), new Function<SegmentIdentifier, Interval>()
@Override public boolean isReady(TaskActionClient taskActionClient) throws Exception { Optional<SortedSet<Interval>> intervals = spec.getDataSchema().getGranularitySpec().bucketIntervals(); if (intervals.isPresent()) { Interval interval = JodaUtils.umbrellaInterval( JodaUtils.condenseIntervals( intervals.get() ) ); return taskActionClient.submit(new LockTryAcquireAction(TaskLockType.EXCLUSIVE, interval)) != null; } else { return true; } }
@VisibleForTesting public static SegmentAnalysis finalizeAnalysis(SegmentAnalysis analysis) { return new SegmentAnalysis( analysis.getId(), analysis.getIntervals() != null ? JodaUtils.condenseIntervals(analysis.getIntervals()) : null, analysis.getColumns(), analysis.getSize(), analysis.getNumRows(), analysis.getAggregators(), analysis.getTimestampSpec(), analysis.getQueryGranularity(), analysis.isRollup() ); }
.getGranularitySpec() .withIntervals( JodaUtils.condenseIntervals( shardSpecs.getIntervals()
if (determineIntervals) { Interval interval = JodaUtils.umbrellaInterval( JodaUtils.condenseIntervals( indexerSchema.getDataSchema().getGranularitySpec().bucketIntervals().get()