diff --git a/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java b/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java index 7a40035c3e6..4907ff791aa 100644 --- a/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java +++ b/indexing-service/src/main/java/io/druid/indexing/common/task/RealtimeIndexTask.java @@ -42,7 +42,7 @@ import io.druid.query.QueryRunner; import io.druid.query.QueryRunnerFactory; import io.druid.query.QueryRunnerFactoryConglomerate; import io.druid.query.QueryToolChest; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.realtime.FireDepartment; import io.druid.segment.realtime.FireDepartmentConfig; import io.druid.segment.realtime.RealtimeMetricsMonitor; @@ -90,7 +90,7 @@ public class RealtimeIndexTask extends AbstractTask private final int maxPendingPersists; @JsonIgnore - private final IndexGranularity segmentGranularity; + private final SegmentGranularity segmentGranularity; @JsonIgnore private final RejectionPolicyFactory rejectionPolicyFactory; @@ -110,7 +110,7 @@ public class RealtimeIndexTask extends AbstractTask @JsonProperty("fireDepartmentConfig") FireDepartmentConfig fireDepartmentConfig, @JsonProperty("windowPeriod") Period windowPeriod, @JsonProperty("maxPendingPersists") int maxPendingPersists, - @JsonProperty("segmentGranularity") IndexGranularity segmentGranularity, + @JsonProperty("segmentGranularity") SegmentGranularity segmentGranularity, @JsonProperty("rejectionPolicy") RejectionPolicyFactory rejectionPolicyFactory ) { @@ -399,7 +399,7 @@ public class RealtimeIndexTask extends AbstractTask } @JsonProperty - public IndexGranularity getSegmentGranularity() + public SegmentGranularity getSegmentGranularity() { return segmentGranularity; } diff --git a/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java b/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java index e9ace7ac18a..168de7a8b5e 100644 --- a/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/common/task/TaskSerdeTest.java @@ -35,7 +35,7 @@ import io.druid.jackson.DefaultObjectMapper; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.CountAggregatorFactory; import io.druid.query.aggregation.DoubleSumAggregatorFactory; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.realtime.Schema; import io.druid.segment.realtime.firehose.LocalFirehoseFactory; import io.druid.timeline.DataSegment; @@ -199,7 +199,7 @@ public class TaskSerdeTest null, new Period("PT10M"), 1, - IndexGranularity.HOUR, + SegmentGranularity.HOUR, null ); @@ -213,7 +213,7 @@ public class TaskSerdeTest Assert.assertEquals(2, task.getTaskResource().getRequiredCapacity()); Assert.assertEquals("rofl", task.getTaskResource().getAvailabilityGroup()); Assert.assertEquals(new Period("PT10M"), task.getWindowPeriod()); - Assert.assertEquals(IndexGranularity.HOUR, task.getSegmentGranularity()); + Assert.assertEquals(SegmentGranularity.HOUR, task.getSegmentGranularity()); Assert.assertEquals(task.getId(), task2.getId()); Assert.assertEquals(task.getGroupId(), task2.getGroupId()); diff --git a/indexing-service/src/test/java/io/druid/indexing/worker/TaskAnnouncementTest.java b/indexing-service/src/test/java/io/druid/indexing/worker/TaskAnnouncementTest.java index 303780de3b2..f2af9ec9ab3 100644 --- a/indexing-service/src/test/java/io/druid/indexing/worker/TaskAnnouncementTest.java +++ b/indexing-service/src/test/java/io/druid/indexing/worker/TaskAnnouncementTest.java @@ -27,7 +27,7 @@ import io.druid.indexing.common.task.Task; import io.druid.indexing.common.task.TaskResource; import io.druid.jackson.DefaultObjectMapper; import io.druid.query.aggregation.AggregatorFactory; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.realtime.Schema; import io.druid.timeline.partition.NoneShardSpec; import junit.framework.Assert; @@ -47,7 +47,7 @@ public class TaskAnnouncementTest null, new Period("PT10M"), 1, - IndexGranularity.HOUR, + SegmentGranularity.HOUR, null ); final TaskStatus status = TaskStatus.running(task.getId()); diff --git a/processing/src/main/java/io/druid/segment/IndexGranularity.java b/processing/src/main/java/io/druid/segment/SegmentGranularity.java similarity index 98% rename from processing/src/main/java/io/druid/segment/IndexGranularity.java rename to processing/src/main/java/io/druid/segment/SegmentGranularity.java index 29b3564b4fc..d5f22ed6c66 100644 --- a/processing/src/main/java/io/druid/segment/IndexGranularity.java +++ b/processing/src/main/java/io/druid/segment/SegmentGranularity.java @@ -35,7 +35,7 @@ import org.joda.time.format.DateTimeFormatter; /** */ -public enum IndexGranularity +public enum SegmentGranularity { MINUTE { @@ -542,8 +542,8 @@ public enum IndexGranularity public abstract int numIn(ReadableInterval interval); @JsonCreator - public static IndexGranularity fromString(String s) + public static SegmentGranularity fromString(String s) { - return IndexGranularity.valueOf(s.toUpperCase()); + return SegmentGranularity.valueOf(s.toUpperCase()); } } diff --git a/server/src/main/java/io/druid/segment/indexing/DataSchema.java b/server/src/main/java/io/druid/segment/indexing/DataSchema.java new file mode 100644 index 00000000000..7bb6f3a56cd --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/DataSchema.java @@ -0,0 +1,123 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; +import io.druid.data.input.impl.SpatialDimensionSchema; +import io.druid.data.input.impl.TimestampSpec; +import io.druid.query.aggregation.AggregatorFactory; +import io.druid.timeline.partition.NoneShardSpec; +import io.druid.timeline.partition.ShardSpec; + +import java.util.List; + +/** + */ +public class DataSchema +{ + private final String dataSource; + private final TimestampSpec timestampSpec; + private final List dimensions; + private final List dimensionExclusions; + private final List spatialDimensions; + private final AggregatorFactory[] aggregators; + private final GranularitySpec granularitySpec; + private final ShardSpec shardSpec; + + @JsonCreator + public DataSchema( + @JsonProperty("dataSource") String dataSource, + @JsonProperty("timestampSpec") TimestampSpec timestampSpec, + @JsonProperty("dimensions") List dimensions, + @JsonProperty("dimensionExclusions") List dimensionExclusions, + @JsonProperty("spatialDimensions") List spatialDimensions, + @JsonProperty("metrics") AggregatorFactory[] aggregators, + @JsonProperty("granularitySpec") GranularitySpec granularitySpec, + @JsonProperty("shardSpec") ShardSpec shardSpec + ) + { + Preconditions.checkNotNull(dataSource, "dataSource"); + Preconditions.checkNotNull(timestampSpec, "timestampSpec"); + Preconditions.checkNotNull(aggregators, "metrics"); + Preconditions.checkNotNull(granularitySpec, "granularitySpec"); + + this.dataSource = dataSource; + this.timestampSpec = timestampSpec; + this.dimensions = dimensions; + this.dimensionExclusions = dimensionExclusions; + this.spatialDimensions = (spatialDimensions == null) + ? Lists.newArrayList() + : spatialDimensions; + this.aggregators = aggregators; + this.granularitySpec = granularitySpec; + this.shardSpec = shardSpec == null ? new NoneShardSpec() : shardSpec; + } + + @JsonProperty + public String getDataSource() + { + return dataSource; + } + + @JsonProperty + public TimestampSpec getTimestampSpec() + { + return timestampSpec; + } + + @JsonProperty + public List getDimensions() + { + return dimensions; + } + + @JsonProperty + public List getDimensionExclusions() + { + return dimensionExclusions; + } + + @JsonProperty + public List getSpatialDimensions() + { + return spatialDimensions; + } + + @JsonProperty + public AggregatorFactory[] getAggregators() + { + return aggregators; + } + + @JsonProperty + public GranularitySpec getGranularitySpec() + { + return granularitySpec; + } + + @JsonProperty + public ShardSpec getShardSpec() + { + return shardSpec; + } +} diff --git a/server/src/main/java/io/druid/segment/indexing/DriverConfig.java b/server/src/main/java/io/druid/segment/indexing/DriverConfig.java new file mode 100644 index 00000000000..4b1eac5cc68 --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/DriverConfig.java @@ -0,0 +1,33 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +/** + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") +@JsonSubTypes(value = { + @JsonSubTypes.Type(name = "uniform", value = RealtimeDriverConfig.class) +}) +public interface DriverConfig +{ +} diff --git a/server/src/main/java/io/druid/segment/indexing/GranularitySpec.java b/server/src/main/java/io/druid/segment/indexing/GranularitySpec.java new file mode 100644 index 00000000000..3ea92e69d32 --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/GranularitySpec.java @@ -0,0 +1,55 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.druid.granularity.QueryGranularity; +import io.druid.segment.SegmentGranularity; + +/** + */ +public class GranularitySpec +{ + private final SegmentGranularity segmentGranularity; + private final QueryGranularity queryGranularity; + + @JsonCreator + public GranularitySpec( + @JsonProperty("segmentGranularity") SegmentGranularity segmentGranularity, + @JsonProperty("queryGranularity") QueryGranularity queryGranularity + ) + { + this.segmentGranularity = segmentGranularity; + this.queryGranularity = queryGranularity; + } + + @JsonProperty + public SegmentGranularity getSegmentGranularity() + { + return segmentGranularity; + } + + @JsonProperty + public QueryGranularity getQueryGranularity() + { + return queryGranularity; + } +} diff --git a/server/src/main/java/io/druid/segment/indexing/IngestConfig.java b/server/src/main/java/io/druid/segment/indexing/IngestConfig.java new file mode 100644 index 00000000000..e265ba99083 --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/IngestConfig.java @@ -0,0 +1,27 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +/** + */ + +public interface IngestConfig +{ +} diff --git a/server/src/main/java/io/druid/segment/indexing/IngestionSchema.java b/server/src/main/java/io/druid/segment/indexing/IngestionSchema.java new file mode 100644 index 00000000000..b517ccf06b1 --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/IngestionSchema.java @@ -0,0 +1,62 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + */ +public class IngestionSchema +{ + private final DataSchema dataSchema; + private final DriverConfig driverConfig; + private final IngestConfig ingestConfig; + + @JsonCreator + public IngestionSchema( + @JsonProperty("schema") DataSchema dataSchema, + @JsonProperty("config") DriverConfig driverConfig, + @JsonProperty("ingest") IngestConfig ingestConfig + ) + { + this.dataSchema = dataSchema; + this.driverConfig = driverConfig; + this.ingestConfig = ingestConfig; + } + + @JsonProperty + public DataSchema getDataSchema() + { + return dataSchema; + } + + @JsonProperty + public DriverConfig getDriverConfig() + { + return driverConfig; + } + + @JsonProperty + public IngestConfig getIngestConfig() + { + return ingestConfig; + } +} diff --git a/server/src/main/java/io/druid/segment/indexing/RealtimeDriverConfig.java b/server/src/main/java/io/druid/segment/indexing/RealtimeDriverConfig.java new file mode 100644 index 00000000000..5ae0ff83850 --- /dev/null +++ b/server/src/main/java/io/druid/segment/indexing/RealtimeDriverConfig.java @@ -0,0 +1,84 @@ +/* + * Druid - a distributed column store. + * Copyright (C) 2012, 2013 Metamarkets Group Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package io.druid.segment.indexing; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.druid.segment.realtime.plumber.RejectionPolicyFactory; +import org.joda.time.Period; + +import java.io.File; + +/** + */ +public class RealtimeDriverConfig implements DriverConfig +{ + private final int maxRowsInMemory; + private final Period intermediatePersistPeriod; + private final Period windowPeriod; + private final File basePersistDirectory; + private final RejectionPolicyFactory rejectionPolicyFactory; + + @JsonCreator + public RealtimeDriverConfig( + @JsonProperty("maxRowsInMemory") int maxRowsInMemory, + @JsonProperty("intermediatePersistPeriod") Period intermediatePersistPeriod, + @JsonProperty("windowPeriod") Period windowPeriod, + @JsonProperty("basePersistDirectory") File basePersistDirectory, + @JsonProperty("rejectionPolicyFactory") RejectionPolicyFactory rejectionPolicyFactory + ) + { + this.maxRowsInMemory = maxRowsInMemory; + this.intermediatePersistPeriod = intermediatePersistPeriod; + this.windowPeriod = windowPeriod; + this.basePersistDirectory = basePersistDirectory; + this.rejectionPolicyFactory = rejectionPolicyFactory; + } + + @JsonProperty + public int getMaxRowsInMemory() + { + return maxRowsInMemory; + } + + @JsonProperty + public Period getIntermediatePersistPeriod() + { + return intermediatePersistPeriod; + } + + @JsonProperty + public Period getWindowPeriod() + { + return windowPeriod; + } + + @JsonProperty + public File getBasePersistDirectory() + { + return basePersistDirectory; + } + + @JsonProperty + public RejectionPolicyFactory getRejectionPolicyFactory() + { + return rejectionPolicyFactory; + } +} diff --git a/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumber.java b/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumber.java index 1367e21de88..34de2afb069 100644 --- a/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumber.java +++ b/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumber.java @@ -7,7 +7,7 @@ import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import io.druid.common.guava.ThreadRenamingCallable; import io.druid.query.QueryRunnerFactoryConglomerate; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.realtime.FireDepartmentMetrics; import io.druid.segment.realtime.Schema; import io.druid.server.coordination.DataSegmentAnnouncer; @@ -38,7 +38,7 @@ public class FlushingPlumber extends RealtimePlumber Duration flushDuration, Period windowPeriod, File basePersistDirectory, - IndexGranularity segmentGranularity, + SegmentGranularity segmentGranularity, Schema schema, FireDepartmentMetrics metrics, RejectionPolicy rejectionPolicy, diff --git a/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumberSchool.java b/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumberSchool.java index eeb0b3c03ce..aa4b575696f 100644 --- a/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumberSchool.java +++ b/server/src/main/java/io/druid/segment/realtime/plumber/FlushingPlumberSchool.java @@ -27,7 +27,7 @@ import com.metamx.emitter.EmittingLogger; import com.metamx.emitter.service.ServiceEmitter; import io.druid.guice.annotations.Processing; import io.druid.query.QueryRunnerFactoryConglomerate; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.realtime.FireDepartmentMetrics; import io.druid.segment.realtime.Schema; import io.druid.server.coordination.DataSegmentAnnouncer; @@ -49,7 +49,7 @@ public class FlushingPlumberSchool implements PlumberSchool private final Duration flushDuration; private final Period windowPeriod; private final File basePersistDirectory; - private final IndexGranularity segmentGranularity; + private final SegmentGranularity segmentGranularity; private final int maxPendingPersists; @JacksonInject @@ -77,7 +77,7 @@ public class FlushingPlumberSchool implements PlumberSchool @JsonProperty("flushDuration") Duration flushDuration, @JsonProperty("windowPeriod") Period windowPeriod, @JsonProperty("basePersistDirectory") File basePersistDirectory, - @JsonProperty("segmentGranularity") IndexGranularity segmentGranularity + @JsonProperty("segmentGranularity") SegmentGranularity segmentGranularity ) { this.flushDuration = flushDuration; diff --git a/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumber.java b/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumber.java index 2b4d1f5f44b..38c28ea7db2 100644 --- a/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumber.java +++ b/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumber.java @@ -29,7 +29,7 @@ import io.druid.query.QueryToolChest; import io.druid.query.SegmentDescriptor; import io.druid.query.spec.SpecificSegmentQueryRunner; import io.druid.query.spec.SpecificSegmentSpec; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.IndexIO; import io.druid.segment.IndexMerger; import io.druid.segment.QueryableIndex; @@ -71,7 +71,7 @@ public class RealtimePlumber implements Plumber private final Period windowPeriod; private final File basePersistDirectory; - private final IndexGranularity segmentGranularity; + private final SegmentGranularity segmentGranularity; private final Schema schema; private final FireDepartmentMetrics metrics; private final RejectionPolicy rejectionPolicy; @@ -99,7 +99,7 @@ public class RealtimePlumber implements Plumber public RealtimePlumber( Period windowPeriod, File basePersistDirectory, - IndexGranularity segmentGranularity, + SegmentGranularity segmentGranularity, Schema schema, FireDepartmentMetrics metrics, RejectionPolicy rejectionPolicy, @@ -141,7 +141,7 @@ public class RealtimePlumber implements Plumber return windowPeriod; } - public IndexGranularity getSegmentGranularity() + public SegmentGranularity getSegmentGranularity() { return segmentGranularity; } diff --git a/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumberSchool.java b/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumberSchool.java index f7d6398a194..2790961243d 100644 --- a/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumberSchool.java +++ b/server/src/main/java/io/druid/segment/realtime/plumber/RealtimePlumberSchool.java @@ -28,7 +28,7 @@ import com.metamx.emitter.service.ServiceEmitter; import io.druid.client.ServerView; import io.druid.guice.annotations.Processing; import io.druid.query.QueryRunnerFactoryConglomerate; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.loading.DataSegmentPusher; import io.druid.segment.realtime.FireDepartmentMetrics; import io.druid.segment.realtime.Schema; @@ -50,7 +50,7 @@ public class RealtimePlumberSchool implements PlumberSchool private final Period windowPeriod; private final File basePersistDirectory; - private final IndexGranularity segmentGranularity; + private final SegmentGranularity segmentGranularity; @JacksonInject @NotNull @@ -89,7 +89,7 @@ public class RealtimePlumberSchool implements PlumberSchool public RealtimePlumberSchool( @JsonProperty("windowPeriod") Period windowPeriod, @JsonProperty("basePersistDirectory") File basePersistDirectory, - @JsonProperty("segmentGranularity") IndexGranularity segmentGranularity + @JsonProperty("segmentGranularity") SegmentGranularity segmentGranularity ) { this.windowPeriod = windowPeriod; diff --git a/server/src/main/java/io/druid/server/http/DatasourcesResource.java b/server/src/main/java/io/druid/server/http/DatasourcesResource.java index c77e6fee9bb..8a10a07987d 100644 --- a/server/src/main/java/io/druid/server/http/DatasourcesResource.java +++ b/server/src/main/java/io/druid/server/http/DatasourcesResource.java @@ -31,7 +31,6 @@ import io.druid.client.DruidServer; import io.druid.client.InventoryView; import io.druid.client.indexing.IndexingServiceClient; import io.druid.db.DatabaseSegmentManager; -import io.druid.segment.IndexGranularity; import io.druid.timeline.DataSegment; import org.joda.time.Interval; diff --git a/server/src/test/java/io/druid/segment/realtime/plumber/RealtimePlumberSchoolTest.java b/server/src/test/java/io/druid/segment/realtime/plumber/RealtimePlumberSchoolTest.java index 39400f30cbf..d319ad3cd1c 100644 --- a/server/src/test/java/io/druid/segment/realtime/plumber/RealtimePlumberSchoolTest.java +++ b/server/src/test/java/io/druid/segment/realtime/plumber/RealtimePlumberSchoolTest.java @@ -34,7 +34,7 @@ import io.druid.query.Query; import io.druid.query.QueryRunnerFactory; import io.druid.query.aggregation.AggregatorFactory; import io.druid.query.aggregation.CountAggregatorFactory; -import io.druid.segment.IndexGranularity; +import io.druid.segment.SegmentGranularity; import io.druid.segment.loading.DataSegmentPusher; import io.druid.segment.realtime.FireDepartmentMetrics; import io.druid.segment.realtime.Schema; @@ -86,7 +86,7 @@ public class RealtimePlumberSchoolTest RealtimePlumberSchool realtimePlumberSchool = new RealtimePlumberSchool( new Period("PT10m"), tmpDir, - IndexGranularity.HOUR + SegmentGranularity.HOUR ); announcer = EasyMock.createMock(DataSegmentAnnouncer.class);