Skip to content

Commit 3ce4fe8

Browse files
committed
refactor a bit
1 parent 8cbf532 commit 3ce4fe8

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingContext.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,6 @@ public boolean hasWaitingTasks() {
174174
}
175175

176176
public boolean isEmpty() {
177-
return anomalyDetectionTasks.isEmpty()
178-
&& snapshotUpgradeTasks.isEmpty()
179-
&& dataframeAnalyticsTasks.isEmpty()
180-
&& modelAssignments.isEmpty();
181-
}
182-
183-
public boolean hasOnlyZeroAllocationModels() {
184177
return anomalyDetectionTasks.isEmpty()
185178
&& snapshotUpgradeTasks.isEmpty()
186179
&& dataframeAnalyticsTasks.isEmpty()

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/autoscaling/MlAutoscalingDeciderService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public AutoscalingDeciderResult scale(Settings configuration, AutoscalingDecider
131131
.setPassedConfiguration(configuration);
132132

133133
// We don't need to check anything as there are no tasks
134-
if (mlContext.isEmpty() || mlContext.hasOnlyZeroAllocationModels()) {
134+
if (mlContext.isEmpty()) {
135135
// This is a quick path to downscale.
136136
// simply return `0` for scale down if delay is satisfied
137137
return downscaleToZero(configuration, context, currentNativeMemoryCapacity, reasonBuilder);

0 commit comments

Comments
 (0)