@Override public GranularitySpec withIntervals(List<Interval> inputIntervals) { return new UniformGranularitySpec(segmentGranularity, queryGranularity, rollup, inputIntervals); } }
this.granularitySpec = new UniformGranularitySpec(null, null, null); } else { this.granularitySpec = granularitySpec;
new UniformGranularitySpec( segmentGranularity, config.getGranularitySpec().getQueryGranularity(),
tmpDir, DEFAULT_PARSE_SPEC, new UniformGranularitySpec( Granularities.HOUR, Granularities.MINUTE,
tmpDir, null, new UniformGranularitySpec( Granularities.HOUR, Granularities.HOUR,
@Test public void testRollupSetting() { List<Interval> intervals = Lists.newArrayList( Intervals.of("2012-01-08T00Z/2012-01-11T00Z"), Intervals.of("2012-01-07T00Z/2012-01-08T00Z"), Intervals.of("2012-01-03T00Z/2012-01-04T00Z"), Intervals.of("2012-01-01T00Z/2012-01-03T00Z") ); final GranularitySpec spec = new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, false, intervals); Assert.assertFalse(spec.isRollup()); }
tmpDir, null, new UniformGranularitySpec( Granularities.HOUR, Granularities.MINUTE,
@Test public void testEquals() { final GranularitySpec spec = new UniformGranularitySpec( Granularities.DAY, null, Lists.newArrayList( Intervals.of("2012-01-08T00Z/2012-01-11T00Z"), Intervals.of("2012-01-07T00Z/2012-01-08T00Z"), Intervals.of("2012-01-03T00Z/2012-01-04T00Z"), Intervals.of("2012-01-01T00Z/2012-01-03T00Z") ) ); equalsCheck( spec, new UniformGranularitySpec( Granularities.DAY, null, Lists.newArrayList( Intervals.of("2012-01-08T00Z/2012-01-11T00Z"), Intervals.of("2012-01-07T00Z/2012-01-08T00Z"), Intervals.of("2012-01-03T00Z/2012-01-04T00Z"), Intervals.of("2012-01-01T00Z/2012-01-03T00Z") ) ) ); }
tmpDir, null, new UniformGranularitySpec( Granularities.HOUR, Granularities.MINUTE,
@Test public void testJson() { final GranularitySpec spec = new UniformGranularitySpec( Granularities.DAY, null, Lists.newArrayList( Intervals.of("2012-01-08T00Z/2012-01-11T00Z"), Intervals.of("2012-01-07T00Z/2012-01-08T00Z"), Intervals.of("2012-01-03T00Z/2012-01-04T00Z"), Intervals.of("2012-01-01T00Z/2012-01-03T00Z") ) ); try { final GranularitySpec rtSpec = jsonMapper.readValue(jsonMapper.writeValueAsString(spec), GranularitySpec.class); Assert.assertEquals( "Round-trip bucketIntervals", spec.bucketIntervals(), rtSpec.bucketIntervals() ); Assert.assertEquals( "Round-trip granularity", spec.getSegmentGranularity(), rtSpec.getSegmentGranularity() ); } catch (Exception e) { throw Throwables.propagate(e); } }
new LongSumAggregatorFactory("val", "val") }, granularitySpec != null ? granularitySpec : new UniformGranularitySpec( Granularities.DAY, Granularities.MINUTE,
null, new AggregatorFactory[]{new LongSumAggregatorFactory("count", "rows")}, new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null), null, mapper
tmpDir, null, new UniformGranularitySpec( Granularities.DAY, Granularities.DAY,
new LongSumAggregatorFactory("val", "val") }, granularitySpec != null ? granularitySpec : new UniformGranularitySpec( Granularities.DAY, Granularities.MINUTE,
tmpDir, null, new UniformGranularitySpec( Granularities.DAY, Granularities.DAY,
null, new AggregatorFactory[]{new DoubleSumAggregatorFactory("met", "met")}, new UniformGranularitySpec( Granularities.DAY, null,
new HadoopIngestionSpec( new DataSchema( "foo", null, new AggregatorFactory[0], new UniformGranularitySpec( Granularities.DAY, null,
@Test public void testPeriodSegmentGranularity() final GranularitySpec spec = new UniformGranularitySpec( new PeriodGranularity(new Period("P1D"), null, DateTimes.inferTzFromString("America/Los_Angeles")), null,
@Test public void testSimple() final GranularitySpec spec = new UniformGranularitySpec( Granularities.DAY, null,
private static class TestFirehoseFactory implements FirehoseFactory<InputRowParser> { public TestFirehoseFactory() { } @Override @SuppressWarnings("unchecked") public Firehose connect(InputRowParser parser, File temporaryDirectory) throws ParseException { return new TestFirehose(parser); } }