Search in sources :

Example 1 with ServerTimeRejectionPolicyFactory

use of io.druid.segment.realtime.plumber.ServerTimeRejectionPolicyFactory in project druid by druid-io.

the class RealtimeIndexTaskTest method makeRealtimeTask.

private RealtimeIndexTask makeRealtimeTask(final String taskId, boolean reportParseExceptions, long handoffTimeout) {
    ObjectMapper objectMapper = new DefaultObjectMapper();
    DataSchema dataSchema = new DataSchema("test_ds", null, new AggregatorFactory[] { new CountAggregatorFactory("rows"), new LongSumAggregatorFactory("met1", "met1") }, new UniformGranularitySpec(Granularities.DAY, Granularities.NONE, null), objectMapper);
    RealtimeIOConfig realtimeIOConfig = new RealtimeIOConfig(new TestFirehoseFactory(), null, null);
    RealtimeTuningConfig realtimeTuningConfig = new RealtimeTuningConfig(1000, new Period("P1Y"), new Period("PT10M"), null, null, new ServerTimeRejectionPolicyFactory(), null, null, null, buildV9Directly, 0, 0, reportParseExceptions, handoffTimeout);
    return new RealtimeIndexTask(taskId, null, new FireDepartment(dataSchema, realtimeIOConfig, realtimeTuningConfig), null) {

        @Override
        protected boolean isFirehoseDrainableByClosing(FirehoseFactory firehoseFactory) {
            return true;
        }
    };
}
Also used : RealtimeIOConfig(io.druid.segment.indexing.RealtimeIOConfig) FirehoseFactory(io.druid.data.input.FirehoseFactory) LongSumAggregatorFactory(io.druid.query.aggregation.LongSumAggregatorFactory) Period(org.joda.time.Period) RealtimeTuningConfig(io.druid.segment.indexing.RealtimeTuningConfig) DataSchema(io.druid.segment.indexing.DataSchema) UniformGranularitySpec(io.druid.segment.indexing.granularity.UniformGranularitySpec) FireDepartment(io.druid.segment.realtime.FireDepartment) ServerTimeRejectionPolicyFactory(io.druid.segment.realtime.plumber.ServerTimeRejectionPolicyFactory) CountAggregatorFactory(io.druid.query.aggregation.CountAggregatorFactory) DefaultObjectMapper(io.druid.jackson.DefaultObjectMapper) DefaultObjectMapper(io.druid.jackson.DefaultObjectMapper) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 FirehoseFactory (io.druid.data.input.FirehoseFactory)1 DefaultObjectMapper (io.druid.jackson.DefaultObjectMapper)1 CountAggregatorFactory (io.druid.query.aggregation.CountAggregatorFactory)1 LongSumAggregatorFactory (io.druid.query.aggregation.LongSumAggregatorFactory)1 DataSchema (io.druid.segment.indexing.DataSchema)1 RealtimeIOConfig (io.druid.segment.indexing.RealtimeIOConfig)1 RealtimeTuningConfig (io.druid.segment.indexing.RealtimeTuningConfig)1 UniformGranularitySpec (io.druid.segment.indexing.granularity.UniformGranularitySpec)1 FireDepartment (io.druid.segment.realtime.FireDepartment)1 ServerTimeRejectionPolicyFactory (io.druid.segment.realtime.plumber.ServerTimeRejectionPolicyFactory)1 Period (org.joda.time.Period)1