add context to kafka supervisor for the kafka indexing task (#3464)

This commit is contained in:
Parag Jain 2016-10-04 20:08:43 -05:00 committed by GitHub
parent e419407eba
commit 592903571a
3 changed files with 13 additions and 1 deletions

View File

@ -1272,7 +1272,7 @@ public class KafkaSupervisor implements Supervisor
spec.getDataSchema(),
taskTuningConfig,
kafkaIOConfig,
ImmutableMap.<String, Object>of(),
spec.getContext(),
null
);

View File

@ -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()
{

View File

@ -1632,6 +1632,7 @@ public class KafkaSupervisorTest extends EasyMockSupport
dataSchema,
tuningConfig,
kafkaSupervisorIOConfig,
null,
taskStorage,
taskMaster,
indexerMetadataStorageCoordinator,