mirror of https://github.com/apache/druid.git
refactoring - made json type infos consistent for all query types
This commit is contained in:
parent
a6dc29cf85
commit
488b3ef8ff
|
@ -42,14 +42,16 @@ import java.util.Map;
|
|||
@JsonSubTypes.Type(name = Query.TIMESERIES, value = TimeseriesQuery.class),
|
||||
@JsonSubTypes.Type(name = Query.SEARCH, value = SearchQuery.class),
|
||||
@JsonSubTypes.Type(name = Query.TIME_BOUNDARY, value = TimeBoundaryQuery.class),
|
||||
@JsonSubTypes.Type(name = "groupBy", value= GroupByQuery.class),
|
||||
@JsonSubTypes.Type(name = "segmentMetadata", value= SegmentMetadataQuery.class)
|
||||
@JsonSubTypes.Type(name = Query.GROUP_BY, value = GroupByQuery.class),
|
||||
@JsonSubTypes.Type(name = Query.SEGMENT_METADATA, value = SegmentMetadataQuery.class)
|
||||
})
|
||||
public interface Query<T>
|
||||
{
|
||||
public static final String TIMESERIES = "timeseries";
|
||||
public static final String SEARCH = "search";
|
||||
public static final String TIME_BOUNDARY = "timeBoundary";
|
||||
public static final String GROUP_BY = "groupBy";
|
||||
public static final String SEGMENT_METADATA = "segmentMetadata";
|
||||
|
||||
public String getDataSource();
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ public class GroupByQuery extends BaseQuery<Row>
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return "groupBy";
|
||||
return Query.GROUP_BY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package com.metamx.druid.query.metadata;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.metamx.druid.BaseQuery;
|
||||
import com.metamx.druid.Query;
|
||||
|
@ -32,6 +33,7 @@ public class SegmentMetadataQuery extends BaseQuery<SegmentAnalysis>
|
|||
private final ColumnIncluderator toInclude;
|
||||
private final boolean merge;
|
||||
|
||||
@JsonCreator
|
||||
public SegmentMetadataQuery(
|
||||
@JsonProperty("dataSource") String dataSource,
|
||||
@JsonProperty("intervals") QuerySegmentSpec querySegmentSpec,
|
||||
|
@ -67,7 +69,7 @@ public class SegmentMetadataQuery extends BaseQuery<SegmentAnalysis>
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return "segmentMetadata";
|
||||
return Query.SEGMENT_METADATA;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,8 +43,6 @@ import java.util.Map;
|
|||
@JsonTypeName("timeseries")
|
||||
public class TimeseriesQuery extends BaseQuery<Result<TimeseriesResultValue>>
|
||||
{
|
||||
public static final String TIMESERIES = "timeseries";
|
||||
|
||||
private final DimFilter dimFilter;
|
||||
private final QueryGranularity granularity;
|
||||
private final List<AggregatorFactory> aggregatorSpecs;
|
||||
|
@ -79,7 +77,7 @@ public class TimeseriesQuery extends BaseQuery<Result<TimeseriesResultValue>>
|
|||
@Override
|
||||
public String getType()
|
||||
{
|
||||
return TIMESERIES;
|
||||
return Query.TIMESERIES;
|
||||
}
|
||||
|
||||
@JsonProperty("filter")
|
||||
|
|
Loading…
Reference in New Issue