You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: embedded-tests/src/test/java/org/apache/druid/testing/embedded/indexing/autoscaler/CostBasedAutoScalerIntegrationTest.java
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,8 @@ public void test_autoScaler_computesOptimalTaskCountAndProduceScaleDown()
132
132
// Weight configuration: strongly favor lag reduction over idle time
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScaler.java
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,8 @@ public class CostBasedAutoScaler implements SupervisorTaskAutoScaler
90
90
privatefinalWeightedCostFunctioncostFunction;
91
91
privatevolatileCostMetricslastKnownMetrics;
92
92
93
+
privateintscaleDownCounter = 0;
94
+
93
95
publicCostBasedAutoScaler(
94
96
SeekableStreamSupervisorsupervisor,
95
97
CostBasedAutoScalerConfigconfig,
@@ -148,7 +150,11 @@ public void reset()
148
150
@Override
149
151
publicintcomputeTaskCountForRollover()
150
152
{
151
-
returncomputeOptimalTaskCount(lastKnownMetrics);
153
+
if (config.isScaleDownOnTaskRolloverOnly()) {
154
+
returncomputeOptimalTaskCount(lastKnownMetrics);
155
+
} else {
156
+
return -1;
157
+
}
152
158
}
153
159
154
160
publicintcomputeTaskCountForScaleAction()
@@ -157,11 +163,16 @@ public int computeTaskCountForScaleAction()
Copy file name to clipboardExpand all lines: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScalerConfig.java
+45-5Lines changed: 45 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ public class CostBasedAutoScalerConfig implements AutoScalerConfig
Copy file name to clipboardExpand all lines: indexing-service/src/test/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/CostBasedAutoScalerMockTest.java
+63Lines changed: 63 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -257,6 +257,69 @@ public void testBoundaryConditionOptimalEqualsCurrentMinusOne()
0 commit comments