1996fanrui commented on code in PR #921:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/921#discussion_r1901579318


##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/config/AutoScalerOptions.java:
##########
@@ -89,21 +89,41 @@ private static ConfigOptions.OptionBuilder 
autoScalerConfig(String key) {
                                     + "seconds suffix, daily expression's 
formation is startTime-endTime, such as 9:30:30-10:50:20, when exclude from 
9:30:30-10:50:20 in Monday and Thursday "
                                     + "we can express it as 9:30:30-10:50:20 
&& * * * ? * 2,5");
 
-    public static final ConfigOption<Double> TARGET_UTILIZATION =
-            autoScalerConfig("target.utilization")
+    public static final ConfigOption<Double> UTILIZATION_TARGET =
+            autoScalerConfig("utilization.target")
                     .doubleType()
                     .defaultValue(0.7)
-                    
.withFallbackKeys(oldOperatorConfigKey("target.utilization"))
+                    
.withDeprecatedKeys(autoScalerConfigKey("target.utilization"))
+                    .withFallbackKeys(
+                            oldOperatorConfigKey("utilization.target"),
+                            oldOperatorConfigKey("target.utilization"))
                     .withDescription("Target vertex utilization");
 
-    public static final ConfigOption<Double> TARGET_UTILIZATION_BOUNDARY =
-            autoScalerConfig("target.utilization.boundary")
+    public static final ConfigOption<Double> UTILIZATION_TARGET_BOUNDARY =
+            autoScalerConfig("utilization.target.boundary")

Review Comment:
   This option is deprecated, do we need to add a `@Deprecated` annotation here?
   
   Also, IIUC, we don't need to rename the option key name since it's 
deprecated. It means new users don't need it and we don't maintain it in the 
future. (Compatibility needs to be considered only in the short term.)



##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/config/AutoScalerOptions.java:
##########
@@ -89,21 +89,41 @@ private static ConfigOptions.OptionBuilder 
autoScalerConfig(String key) {
                                     + "seconds suffix, daily expression's 
formation is startTime-endTime, such as 9:30:30-10:50:20, when exclude from 
9:30:30-10:50:20 in Monday and Thursday "
                                     + "we can express it as 9:30:30-10:50:20 
&& * * * ? * 2,5");
 
-    public static final ConfigOption<Double> TARGET_UTILIZATION =
-            autoScalerConfig("target.utilization")
+    public static final ConfigOption<Double> UTILIZATION_TARGET =
+            autoScalerConfig("utilization.target")
                     .doubleType()
                     .defaultValue(0.7)
-                    
.withFallbackKeys(oldOperatorConfigKey("target.utilization"))
+                    
.withDeprecatedKeys(autoScalerConfigKey("target.utilization"))
+                    .withFallbackKeys(
+                            oldOperatorConfigKey("utilization.target"),
+                            oldOperatorConfigKey("target.utilization"))
                     .withDescription("Target vertex utilization");
 
-    public static final ConfigOption<Double> TARGET_UTILIZATION_BOUNDARY =
-            autoScalerConfig("target.utilization.boundary")
+    public static final ConfigOption<Double> UTILIZATION_TARGET_BOUNDARY =
+            autoScalerConfig("utilization.target.boundary")
                     .doubleType()
                     .defaultValue(0.3)
                     
.withFallbackKeys(oldOperatorConfigKey("target.utilization.boundary"))
+                    .withFallbackKeys(
+                            
oldOperatorConfigKey("target.utilization.boundary"),
+                            
oldOperatorConfigKey("utilization.target.boundary"))
                     .withDescription(
                             "Target vertex utilization boundary. Scaling won't 
be performed if the processing capacity is within [target_rate / 
(target_utilization - boundary), (target_rate / (target_utilization + 
boundary)]");
 
+    public static final ConfigOption<Double> UTILIZATION_MAX =
+            autoScalerConfig("utilization.max")
+                    .doubleType()
+                    .noDefaultValue()
+                    .withFallbackKeys(oldOperatorConfigKey("utilization.max"))
+                    .withDescription("Max vertex utilization");
+
+    public static final ConfigOption<Double> UTILIZATION_MIN =
+            autoScalerConfig("utilization.min")
+                    .doubleType()
+                    .noDefaultValue()
+                    .withFallbackKeys(oldOperatorConfigKey("utilization.min"))
+                    .withDescription("Min vertex utilization");

Review Comment:
   These 2 options have no default value, I'm not sure whether it's expected.
   
   If the `target.utilization.boundary` is removed in the future, how do we 
handle the default value?
   
   Usually, when a new option is introduced, a default value is also designed. 
When deprecated options are removed in subsequent versions, we only need to 
remove unnecessary compatibility code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to