From 3152d08844678d0248e296cad6f3637931ee284d Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Wed, 20 Jan 2016 14:15:24 -0800 Subject: [PATCH] Fix overlord scheduled executor injection * Fixes https://github.com/druid-io/druid/issues/2308 --- .../overlord/RemoteTaskRunnerFactory.java | 6 ++---- .../SimpleResourceManagementStrategy.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/RemoteTaskRunnerFactory.java b/indexing-service/src/main/java/io/druid/indexing/overlord/RemoteTaskRunnerFactory.java index 9f94635f0b3..b4b046425e6 100644 --- a/indexing-service/src/main/java/io/druid/indexing/overlord/RemoteTaskRunnerFactory.java +++ b/indexing-service/src/main/java/io/druid/indexing/overlord/RemoteTaskRunnerFactory.java @@ -30,7 +30,6 @@ import io.druid.guice.annotations.Global; import io.druid.indexing.overlord.autoscaling.NoopResourceManagementStrategy; import io.druid.indexing.overlord.autoscaling.ResourceManagementSchedulerConfig; import io.druid.indexing.overlord.autoscaling.ResourceManagementStrategy; -import io.druid.indexing.overlord.autoscaling.ScalingStats; import io.druid.indexing.overlord.autoscaling.SimpleResourceManagementConfig; import io.druid.indexing.overlord.autoscaling.SimpleResourceManagementStrategy; import io.druid.indexing.overlord.config.RemoteTaskRunnerConfig; @@ -66,8 +65,7 @@ public class RemoteTaskRunnerFactory implements TaskRunnerFactory workerConfigRef, final ScheduledExecutorFactory factory, final SimpleResourceManagementConfig config, - final ResourceManagementSchedulerConfig resourceManagementSchedulerConfig, - final ScheduledExecutorService exec + final ResourceManagementSchedulerConfig resourceManagementSchedulerConfig ) { this.curator = curator; @@ -79,7 +77,7 @@ public class RemoteTaskRunnerFactory implements TaskRunnerFactory workerConfigRef, + ResourceManagementSchedulerConfig resourceManagementSchedulerConfig, + ScheduledExecutorFactory factory + ) + { + this( + config, + workerConfigRef, + resourceManagementSchedulerConfig, + factory.create(1, "SimpleResourceManagement-manager--%d") + ); + } + public SimpleResourceManagementStrategy( SimpleResourceManagementConfig config, Supplier workerConfigRef,