From 303f6ff33498381d8455043f7b9d085ce42972fd Mon Sep 17 00:00:00 2001 From: fjy Date: Mon, 9 Dec 2013 18:25:29 -0800 Subject: [PATCH] fix worker config setup problems --- .../java/io/druid/indexing/worker/config/WorkerConfig.java | 2 +- services/src/main/java/io/druid/cli/CliOverlord.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/worker/config/WorkerConfig.java b/indexing-service/src/main/java/io/druid/indexing/worker/config/WorkerConfig.java index d510df4c3ee..567dd62aa1f 100644 --- a/indexing-service/src/main/java/io/druid/indexing/worker/config/WorkerConfig.java +++ b/indexing-service/src/main/java/io/druid/indexing/worker/config/WorkerConfig.java @@ -38,7 +38,7 @@ public class WorkerConfig @JsonProperty @Min(1) - private int capacity = Runtime.getRuntime().availableProcessors() - 1; + private int capacity = Math.max(1, Runtime.getRuntime().availableProcessors() - 1); public String getIp() { diff --git a/services/src/main/java/io/druid/cli/CliOverlord.java b/services/src/main/java/io/druid/cli/CliOverlord.java index c0a2d14b54c..c067f57711f 100644 --- a/services/src/main/java/io/druid/cli/CliOverlord.java +++ b/services/src/main/java/io/druid/cli/CliOverlord.java @@ -70,6 +70,7 @@ import io.druid.indexing.overlord.scaling.ResourceManagementStrategy; import io.druid.indexing.overlord.scaling.SimpleResourceManagementConfig; import io.druid.indexing.overlord.scaling.SimpleResourceManagementStrategy; import io.druid.indexing.overlord.setup.WorkerSetupData; +import io.druid.indexing.worker.config.WorkerConfig; import io.druid.server.http.RedirectFilter; import io.druid.server.http.RedirectInfo; import io.druid.server.initialization.JettyServerInitializer; @@ -166,6 +167,8 @@ public class CliOverlord extends ServerRunnable private void configureRunners(Binder binder) { + JsonConfigProvider.bind(binder, "druid.worker", WorkerConfig.class); + PolyBind.createChoice( binder, "druid.indexer.runner.type",