Merge pull request #1842 from metamx/DRUID-1841

Do not pass `druid.indexer.runner.javaOpts` to Peon as a property
This commit is contained in:
Himanshu 2015-10-21 13:15:36 -05:00
commit b7c68ec449
3 changed files with 11 additions and 4 deletions

View File

@ -26,10 +26,11 @@ import io.druid.server.initialization.IndexerZkConfig;
*/ */
public class IndexingServiceModuleHelper public class IndexingServiceModuleHelper
{ {
public static final String INDEXER_RUNNER_PROPERTY_PREFIX = "druid.indexer.runner";
public static void configureTaskRunnerConfigs(Binder binder) public static void configureTaskRunnerConfigs(Binder binder)
{ {
JsonConfigProvider.bind(binder, "druid.indexer.runner", ForkingTaskRunnerConfig.class); JsonConfigProvider.bind(binder, INDEXER_RUNNER_PROPERTY_PREFIX, ForkingTaskRunnerConfig.class);
JsonConfigProvider.bind(binder, "druid.indexer.runner", RemoteTaskRunnerConfig.class); JsonConfigProvider.bind(binder, INDEXER_RUNNER_PROPERTY_PREFIX, RemoteTaskRunnerConfig.class);
JsonConfigProvider.bind(binder, "druid.zk.paths.indexer", IndexerZkConfig.class); JsonConfigProvider.bind(binder, "druid.zk.paths.indexer", IndexerZkConfig.class);
} }
} }

View File

@ -176,7 +176,7 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
// Override task specific javaOpts // Override task specific javaOpts
Object taskJavaOpts = task.getContextValue( Object taskJavaOpts = task.getContextValue(
"druid.indexer.runner.javaOpts" ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY
); );
if (taskJavaOpts != null) { if (taskJavaOpts != null) {
Iterables.addAll( Iterables.addAll(
@ -187,7 +187,9 @@ public class ForkingTaskRunner implements TaskRunner, TaskLogStreamer
for (String propName : props.stringPropertyNames()) { for (String propName : props.stringPropertyNames()) {
for (String allowedPrefix : config.getAllowedPrefixes()) { for (String allowedPrefix : config.getAllowedPrefixes()) {
if (propName.startsWith(allowedPrefix)) { // See https://github.com/druid-io/druid/issues/1841
if (propName.startsWith(allowedPrefix)
&& !ForkingTaskRunnerConfig.JAVA_OPTS_PROPERTY.equals(propName)) {
command.add( command.add(
String.format( String.format(
"-D%s=%s", "-D%s=%s",

View File

@ -19,6 +19,7 @@ package io.druid.indexing.overlord.config;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import io.druid.guice.IndexingServiceModuleHelper;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
@ -27,6 +28,9 @@ import java.util.List;
public class ForkingTaskRunnerConfig public class ForkingTaskRunnerConfig
{ {
public static final String JAVA_OPTS_PROPERTY = IndexingServiceModuleHelper.INDEXER_RUNNER_PROPERTY_PREFIX
+ ".javaOpts";
@JsonProperty @JsonProperty
@NotNull @NotNull
private String javaCommand = "java"; private String javaCommand = "java";