49
49
import static org .apache .flink .autoscaler .JobVertexScaler .INEFFECTIVE_SCALING ;
50
50
import static org .apache .flink .autoscaler .JobVertexScaler .SCALE_LIMITED_MESSAGE_FORMAT ;
51
51
import static org .apache .flink .autoscaler .JobVertexScaler .SCALING_LIMITED ;
52
+ import static org .apache .flink .autoscaler .config .AutoScalerOptions .UTILIZATION_TARGET ;
52
53
import static org .assertj .core .api .Assertions .assertThat ;
53
54
import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
54
55
import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -98,7 +99,7 @@ public void setup() {
98
99
@ MethodSource ("adjustmentInputsProvider" )
99
100
public void testParallelismScaling (Collection <ShipStrategy > inputShipStrategies ) {
100
101
var op = new JobVertexID ();
101
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
102
+ conf .set (UTILIZATION_TARGET , 1. );
102
103
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ZERO );
103
104
var delayedScaleDown = new DelayedScaleDown ();
104
105
@@ -113,7 +114,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
113
114
restartTime ,
114
115
delayedScaleDown ));
115
116
116
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , .8 );
117
+ conf .set (UTILIZATION_TARGET , .8 );
117
118
assertEquals (
118
119
ParallelismChange .build (8 ),
119
120
vertexScaler .computeScaleTargetParallelism (
@@ -125,7 +126,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
125
126
restartTime ,
126
127
delayedScaleDown ));
127
128
128
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , .8 );
129
+ conf .set (UTILIZATION_TARGET , .8 );
129
130
assertEquals (
130
131
ParallelismChange .noChange (),
131
132
vertexScaler .computeScaleTargetParallelism (
@@ -137,7 +138,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
137
138
restartTime ,
138
139
delayedScaleDown ));
139
140
140
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , .8 );
141
+ conf .set (UTILIZATION_TARGET , .8 );
141
142
assertEquals (
142
143
ParallelismChange .build (8 ),
143
144
vertexScaler .computeScaleTargetParallelism (
@@ -160,7 +161,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
160
161
restartTime ,
161
162
delayedScaleDown ));
162
163
163
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 0.5 );
164
+ conf .set (UTILIZATION_TARGET , 0.5 );
164
165
assertEquals (
165
166
ParallelismChange .build (10 ),
166
167
vertexScaler .computeScaleTargetParallelism (
@@ -172,7 +173,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
172
173
restartTime ,
173
174
delayedScaleDown ));
174
175
175
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 0.6 );
176
+ conf .set (UTILIZATION_TARGET , 0.6 );
176
177
assertEquals (
177
178
ParallelismChange .build (4 ),
178
179
vertexScaler .computeScaleTargetParallelism (
@@ -184,7 +185,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
184
185
restartTime ,
185
186
delayedScaleDown ));
186
187
187
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
188
+ conf .set (UTILIZATION_TARGET , 1. );
188
189
conf .set (AutoScalerOptions .MAX_SCALE_DOWN_FACTOR , 0.5 );
189
190
assertEquals (
190
191
ParallelismChange .build (5 ),
@@ -209,7 +210,7 @@ public void testParallelismScaling(Collection<ShipStrategy> inputShipStrategies)
209
210
restartTime ,
210
211
delayedScaleDown ));
211
212
212
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
213
+ conf .set (UTILIZATION_TARGET , 1. );
213
214
conf .set (AutoScalerOptions .MAX_SCALE_UP_FACTOR , 0.5 );
214
215
assertEquals (
215
216
ParallelismChange .build (15 ),
@@ -558,7 +559,7 @@ public void testMinParallelismLimitIsUsed() {
558
559
@ Test
559
560
public void testMaxParallelismLimitIsUsed () {
560
561
conf .setInteger (AutoScalerOptions .VERTEX_MAX_PARALLELISM , 10 );
561
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
562
+ conf .set (UTILIZATION_TARGET , 1. );
562
563
var delayedScaleDown = new DelayedScaleDown ();
563
564
564
565
assertEquals (
@@ -587,7 +588,7 @@ public void testMaxParallelismLimitIsUsed() {
587
588
588
589
@ Test
589
590
public void testDisableScaleDownInterval () {
590
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
591
+ conf .set (UTILIZATION_TARGET , 1. );
591
592
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ofMinutes (0 ));
592
593
593
594
var delayedScaleDown = new DelayedScaleDown ();
@@ -597,7 +598,7 @@ public void testDisableScaleDownInterval() {
597
598
598
599
@ Test
599
600
public void testScaleDownAfterInterval () {
600
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
601
+ conf .set (UTILIZATION_TARGET , 1. );
601
602
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ofMinutes (1 ));
602
603
var instant = Instant .now ();
603
604
@@ -629,7 +630,7 @@ public void testScaleDownAfterInterval() {
629
630
630
631
@ Test
631
632
public void testImmediateScaleUpWithinScaleDownInterval () {
632
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
633
+ conf .set (UTILIZATION_TARGET , 1. );
633
634
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ofMinutes (1 ));
634
635
var instant = Instant .now ();
635
636
@@ -655,7 +656,7 @@ public void testImmediateScaleUpWithinScaleDownInterval() {
655
656
656
657
@ Test
657
658
public void testCancelDelayedScaleDownAfterNewParallelismIsSame () {
658
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
659
+ conf .set (UTILIZATION_TARGET , 1. );
659
660
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ofMinutes (1 ));
660
661
var instant = Instant .now ();
661
662
@@ -701,7 +702,7 @@ private void assertParallelismChange(
701
702
public void testIneffectiveScalingDetection () {
702
703
var op = new JobVertexID ();
703
704
conf .set (AutoScalerOptions .SCALING_EFFECTIVENESS_DETECTION_ENABLED , true );
704
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1. );
705
+ conf .set (UTILIZATION_TARGET , 1. );
705
706
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ZERO );
706
707
707
708
var evaluated = evaluated (5 , 100 , 50 );
@@ -826,7 +827,7 @@ public void testIneffectiveScalingDetection() {
826
827
public void testSendingIneffectiveScalingEvents (Collection <ShipStrategy > inputShipStrategies ) {
827
828
var jobVertexID = new JobVertexID ();
828
829
conf .set (AutoScalerOptions .SCALING_EFFECTIVENESS_DETECTION_ENABLED , true );
829
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1.0 );
830
+ conf .set (UTILIZATION_TARGET , 1.0 );
830
831
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ZERO );
831
832
832
833
var evaluated = evaluated (5 , 100 , 50 );
@@ -1082,7 +1083,7 @@ public void testNumPartitionsAdjustment() {
1082
1083
@ Test
1083
1084
public void testSendingScalingLimitedEvents () {
1084
1085
var jobVertexID = new JobVertexID ();
1085
- conf .set (AutoScalerOptions . TARGET_UTILIZATION , 1.0 );
1086
+ conf .set (UTILIZATION_TARGET , 1.0 );
1086
1087
conf .set (AutoScalerOptions .SCALE_DOWN_INTERVAL , Duration .ZERO );
1087
1088
conf .set (AutoScalerOptions .SCALING_EVENT_INTERVAL , Duration .ZERO );
1088
1089
var evaluated = evaluated (10 , 200 , 100 );
0 commit comments