mirror of https://github.com/apache/druid.git
add context to kafka supervisor for the kafka indexing task (#3464)
This commit is contained in:
parent
e419407eba
commit
592903571a
|
@ -1272,7 +1272,7 @@ public class KafkaSupervisor implements Supervisor
|
|||
spec.getDataSchema(),
|
||||
taskTuningConfig,
|
||||
kafkaIOConfig,
|
||||
ImmutableMap.<String, Object>of(),
|
||||
spec.getContext(),
|
||||
null
|
||||
);
|
||||
|
||||
|
|
|
@ -33,11 +33,14 @@ import io.druid.indexing.overlord.supervisor.Supervisor;
|
|||
import io.druid.indexing.overlord.supervisor.SupervisorSpec;
|
||||
import io.druid.segment.indexing.DataSchema;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class KafkaSupervisorSpec implements SupervisorSpec
|
||||
{
|
||||
private final DataSchema dataSchema;
|
||||
private final KafkaSupervisorTuningConfig tuningConfig;
|
||||
private final KafkaSupervisorIOConfig ioConfig;
|
||||
private final Map<String, Object> context;
|
||||
|
||||
private final TaskStorage taskStorage;
|
||||
private final TaskMaster taskMaster;
|
||||
|
@ -50,6 +53,7 @@ public class KafkaSupervisorSpec implements SupervisorSpec
|
|||
@JsonProperty("dataSchema") DataSchema dataSchema,
|
||||
@JsonProperty("tuningConfig") KafkaSupervisorTuningConfig tuningConfig,
|
||||
@JsonProperty("ioConfig") KafkaSupervisorIOConfig ioConfig,
|
||||
@JsonProperty("context") Map<String, Object> context,
|
||||
@JacksonInject TaskStorage taskStorage,
|
||||
@JacksonInject TaskMaster taskMaster,
|
||||
@JacksonInject IndexerMetadataStorageCoordinator indexerMetadataStorageCoordinator,
|
||||
|
@ -77,6 +81,7 @@ public class KafkaSupervisorSpec implements SupervisorSpec
|
|||
null
|
||||
);
|
||||
this.ioConfig = Preconditions.checkNotNull(ioConfig, "ioConfig");
|
||||
this.context = context;
|
||||
|
||||
this.taskStorage = taskStorage;
|
||||
this.taskMaster = taskMaster;
|
||||
|
@ -103,6 +108,12 @@ public class KafkaSupervisorSpec implements SupervisorSpec
|
|||
return ioConfig;
|
||||
}
|
||||
|
||||
@JsonProperty
|
||||
public Map<String, Object> getContext()
|
||||
{
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId()
|
||||
{
|
||||
|
|
|
@ -1632,6 +1632,7 @@ public class KafkaSupervisorTest extends EasyMockSupport
|
|||
dataSchema,
|
||||
tuningConfig,
|
||||
kafkaSupervisorIOConfig,
|
||||
null,
|
||||
taskStorage,
|
||||
taskMaster,
|
||||
indexerMetadataStorageCoordinator,
|
||||
|
|
Loading…
Reference in New Issue