Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2d314e3
accept spec or dataSchema, tuningConfig, ioConfig while submitting ta…
Nov 2, 2019
bd4c1ce
fix test
Nov 2, 2019
ffff56b
update docs
Nov 2, 2019
c34c5cf
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 6, 2019
5cab838
lgtm warning
Nov 6, 2019
8d0c0a6
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 6, 2019
473a969
Add original constructor back to IndexTask to minimize changes
Nov 13, 2019
4aaa3f8
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 13, 2019
47fd2ba
fix indentation in docs
Nov 13, 2019
1036301
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 17, 2019
4c59452
Allow spec to be specified in supervisor schema
Nov 18, 2019
bb22f82
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 18, 2019
65d0bf5
undo IndexTask spec changes
Nov 18, 2019
dc4cbed
update docs
Nov 18, 2019
cd3ea65
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 18, 2019
98c82eb
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 19, 2019
397e467
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 19, 2019
9384bce
Add Nullable and deprecated annotations
Nov 19, 2019
da93905
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 19, 2019
e70e42f
remove deprecated configs from SeekableStreamSupervisorSpec
Nov 20, 2019
be92a1d
remove nullable annotation
Nov 20, 2019
3bf5601
Merge branch 'master' of https://github.com/apache/incubator-druid in…
Nov 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 53 additions & 51 deletions docs/tutorials/tutorial-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,60 +180,62 @@ Paste in this spec and click `Submit`.
```json
{
"type": "kafka",
"dataSchema": {
"dataSource": "wikipedia",
"parser": {
"type": "string",
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "time",
"format": "auto"
},
"dimensionsSpec": {
"dimensions": [
"channel",
"cityName",
"comment",
"countryIsoCode",
"countryName",
"isAnonymous",
"isMinor",
"isNew",
"isRobot",
"isUnpatrolled",
"metroCode",
"namespace",
"page",
"regionIsoCode",
"regionName",
"user",
{ "name": "added", "type": "long" },
{ "name": "deleted", "type": "long" },
{ "name": "delta", "type": "long" }
]
"spec" : {
"dataSchema": {
"dataSource": "wikipedia",
"parser": {
"type": "string",
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "time",
"format": "auto"
},
"dimensionsSpec": {
"dimensions": [
"channel",
"cityName",
"comment",
"countryIsoCode",
"countryName",
"isAnonymous",
"isMinor",
"isNew",
"isRobot",
"isUnpatrolled",
"metroCode",
"namespace",
"page",
"regionIsoCode",
"regionName",
"user",
{ "name": "added", "type": "long" },
{ "name": "deleted", "type": "long" },
{ "name": "delta", "type": "long" }
]
}
}
},
"metricsSpec" : [],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "DAY",
"queryGranularity": "NONE",
"rollup": false
}
},
"metricsSpec" : [],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "DAY",
"queryGranularity": "NONE",
"rollup": false
}
},
"tuningConfig": {
"type": "kafka",
"reportParseExceptions": false
},
"ioConfig": {
"topic": "wikipedia",
"replicas": 2,
"taskDuration": "PT10M",
"completionTimeout": "PT20M",
"consumerProperties": {
"bootstrap.servers": "localhost:9092"
"tuningConfig": {
"type": "kafka",
"reportParseExceptions": false
},
"ioConfig": {
"topic": "wikipedia",
"replicas": 2,
"taskDuration": "PT10M",
"completionTimeout": "PT20M",
"consumerProperties": {
"bootstrap.servers": "localhost:9092"
}
}
}
}
Expand Down
113 changes: 62 additions & 51 deletions examples/quickstart/tutorial/wikipedia-kafka-supervisor.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,70 @@
{
"type": "kafka",
"dataSchema": {
"dataSource": "wikipedia",
"parser": {
"type": "string",
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "time",
"format": "auto"
},
"dimensionsSpec": {
"dimensions": [
"channel",
"cityName",
"comment",
"countryIsoCode",
"countryName",
"isAnonymous",
"isMinor",
"isNew",
"isRobot",
"isUnpatrolled",
"metroCode",
"namespace",
"page",
"regionIsoCode",
"regionName",
"user",
{ "name": "added", "type": "long" },
{ "name": "deleted", "type": "long" },
{ "name": "delta", "type": "long" }
]
"spec" : {
"dataSchema": {
"dataSource": "wikipedia",
"parser": {
"type": "string",
"parseSpec": {
"format": "json",
"timestampSpec": {
"column": "time",
"format": "auto"
},
"dimensionsSpec": {
"dimensions": [
"channel",
"cityName",
"comment",
"countryIsoCode",
"countryName",
"isAnonymous",
"isMinor",
"isNew",
"isRobot",
"isUnpatrolled",
"metroCode",
"namespace",
"page",
"regionIsoCode",
"regionName",
"user",
{
"name": "added",
"type": "long"
},
{
"name": "deleted",
"type": "long"
},
{
"name": "delta",
"type": "long"
}
]
}
}
},
"metricsSpec": [],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "DAY",
"queryGranularity": "NONE",
"rollup": false
}
},
"metricsSpec" : [],
"granularitySpec": {
"type": "uniform",
"segmentGranularity": "DAY",
"queryGranularity": "NONE",
"rollup": false
}
},
"tuningConfig": {
"type": "kafka",
"reportParseExceptions": false
},
"ioConfig": {
"topic": "wikipedia",
"replicas": 1,
"taskDuration": "PT10M",
"completionTimeout": "PT20M",
"consumerProperties": {
"bootstrap.servers": "localhost:9092"
"tuningConfig": {
"type": "kafka",
"reportParseExceptions": false
},
"ioConfig": {
"topic": "wikipedia",
"replicas": 1,
"taskDuration": "PT10M",
"completionTimeout": "PT20M",
"consumerProperties": {
"bootstrap.servers": "localhost:9092"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.druid.indexing.kafka.supervisor;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.druid.indexing.seekablestream.supervisor.SeekableStreamSupervisorIngestionSpec;
import org.apache.druid.segment.indexing.DataSchema;

public class KafkaSupervisorIngestionSpec extends SeekableStreamSupervisorIngestionSpec
{
private final DataSchema dataSchema;
private final KafkaSupervisorIOConfig ioConfig;
private final KafkaSupervisorTuningConfig tuningConfig;

@JsonCreator
public KafkaSupervisorIngestionSpec(
@JsonProperty("dataSchema") DataSchema dataSchema,
@JsonProperty("ioConfig") KafkaSupervisorIOConfig ioConfig,
@JsonProperty("tuningConfig") KafkaSupervisorTuningConfig tuningConfig
)
{
super(dataSchema, ioConfig, tuningConfig);
this.dataSchema = dataSchema;
this.ioConfig = ioConfig;
this.tuningConfig = tuningConfig == null ? KafkaSupervisorTuningConfig.defaultConfig() : tuningConfig;
}

@Override
@JsonProperty("dataSchema")
public DataSchema getDataSchema()
{
return dataSchema;
}

@Override
@JsonProperty("ioConfig")
public KafkaSupervisorIOConfig getIOConfig()
{
return ioConfig;
}

@Override
@JsonProperty("tuningConfig")
public KafkaSupervisorTuningConfig getTuningConfig()
{
return tuningConfig;
}
}
Loading