mirror of https://github.com/apache/druid.git
Merge pull request #2309 from metamx/fix2308
Fix overlord scheduled executor injection
This commit is contained in:
commit
551d08da2a
|
@ -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<RemoteTaskRunn
|
|||
final Supplier<WorkerBehaviorConfig> 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<RemoteTaskRunn
|
|||
this.cleanupExec = factory.create(1, "RemoteTaskRunner-Scheduled-Cleanup--%d");
|
||||
this.config = config;
|
||||
this.resourceManagementSchedulerConfig = resourceManagementSchedulerConfig;
|
||||
this.exec = exec;
|
||||
this.exec = factory.create(1, "RemoteTaskRunner-ResourceManagement--%d");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -29,6 +29,7 @@ import com.google.common.collect.Lists;
|
|||
import com.google.common.collect.Sets;
|
||||
import com.google.inject.Inject;
|
||||
import com.metamx.common.ISE;
|
||||
import com.metamx.common.concurrent.ScheduledExecutorFactory;
|
||||
import com.metamx.common.concurrent.ScheduledExecutors;
|
||||
import com.metamx.emitter.EmittingLogger;
|
||||
import io.druid.granularity.PeriodGranularity;
|
||||
|
@ -69,6 +70,21 @@ public class SimpleResourceManagementStrategy implements ResourceManagementStrat
|
|||
private DateTime lastTerminateTime = new DateTime();
|
||||
|
||||
@Inject
|
||||
public SimpleResourceManagementStrategy(
|
||||
SimpleResourceManagementConfig config,
|
||||
Supplier<WorkerBehaviorConfig> workerConfigRef,
|
||||
ResourceManagementSchedulerConfig resourceManagementSchedulerConfig,
|
||||
ScheduledExecutorFactory factory
|
||||
)
|
||||
{
|
||||
this(
|
||||
config,
|
||||
workerConfigRef,
|
||||
resourceManagementSchedulerConfig,
|
||||
factory.create(1, "SimpleResourceManagement-manager--%d")
|
||||
);
|
||||
}
|
||||
|
||||
public SimpleResourceManagementStrategy(
|
||||
SimpleResourceManagementConfig config,
|
||||
Supplier<WorkerBehaviorConfig> workerConfigRef,
|
||||
|
|
Loading…
Reference in New Issue