mirror of https://github.com/apache/druid.git
bug fix for autoscaling termination
This commit is contained in:
parent
fa733565e8
commit
26ed96f05d
|
@ -177,22 +177,19 @@ public class RemoteTaskRunner implements TaskRunner
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<WorkerWrapper> thoseLazyWorkers = Lists.newArrayList(
|
int workerCount = 0;
|
||||||
FunctionalIterable
|
List<WorkerWrapper> thoseLazyWorkers = Lists.newArrayList();
|
||||||
.create(zkWorkers.values())
|
for (WorkerWrapper workerWrapper : zkWorkers.values()) {
|
||||||
.filter(
|
workerCount++;
|
||||||
new Predicate<WorkerWrapper>()
|
|
||||||
{
|
if (workerCount > workerSetupManager.getWorkerSetupData().getMinNumWorkers() &&
|
||||||
@Override
|
workerWrapper.getRunningTasks().isEmpty() &&
|
||||||
public boolean apply(WorkerWrapper input)
|
System.currentTimeMillis() - workerWrapper.getLastCompletedTaskTime().getMillis()
|
||||||
{
|
> config.getMaxWorkerIdleTimeMillisBeforeDeletion()
|
||||||
return input.getRunningTasks().isEmpty()
|
) {
|
||||||
&& System.currentTimeMillis() - input.getLastCompletedTaskTime().getMillis()
|
thoseLazyWorkers.add(workerWrapper);
|
||||||
> config.getMaxWorkerIdleTimeMillisBeforeDeletion();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
AutoScalingData terminated = strategy.terminate(
|
AutoScalingData terminated = strategy.terminate(
|
||||||
Lists.transform(
|
Lists.transform(
|
||||||
|
|
|
@ -38,7 +38,7 @@ public abstract class RemoteTaskRunnerConfig extends IndexerZkConfig
|
||||||
public abstract DateTime getTerminateResourcesOriginDateTime();
|
public abstract DateTime getTerminateResourcesOriginDateTime();
|
||||||
|
|
||||||
@Config("druid.indexer.maxWorkerIdleTimeMillisBeforeDeletion")
|
@Config("druid.indexer.maxWorkerIdleTimeMillisBeforeDeletion")
|
||||||
@Default("10000")
|
@Default("600000")
|
||||||
public abstract int getMaxWorkerIdleTimeMillisBeforeDeletion();
|
public abstract int getMaxWorkerIdleTimeMillisBeforeDeletion();
|
||||||
|
|
||||||
@Config("druid.indexer.maxScalingDuration")
|
@Config("druid.indexer.maxScalingDuration")
|
||||||
|
|
Loading…
Reference in New Issue