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


##########
flink-autoscaler/src/main/java/org/apache/flink/autoscaler/config/AutoScalerOptions.java:
##########
@@ -247,21 +221,36 @@ private static ConfigOptions.OptionBuilder 
autoScalerConfig(String key) {
                     .stringType()
                     .asList()
                     .defaultValues()
-                    
.withFallbackKeys(oldOperatorConfigKey("vertex.exclude.ids"))
                     .withDescription(
                             "A (semicolon-separated) list of vertex ids in 
hexstring for which to disable scaling. Caution: For non-sink vertices this 
will still scale their downstream operators until 
https://issues.apache.org/jira/browse/FLINK-31215 is implemented.");
 
     public static final ConfigOption<Duration> SCALING_EVENT_INTERVAL =
             autoScalerConfig("scaling.event.interval")
                     .durationType()
                     .defaultValue(Duration.ofMinutes(30))
-                    
.withFallbackKeys(oldOperatorConfigKey("scaling.event.interval"))
                     .withDescription("Time interval to resend the identical 
event");
 
     public static final ConfigOption<Duration> FLINK_CLIENT_TIMEOUT =
             autoScalerConfig("flink.rest-client.timeout")
                     .durationType()
                     .defaultValue(Duration.ofSeconds(10))
-                    
.withFallbackKeys(oldOperatorConfigKey("flink.rest-client.timeout"))
                     .withDescription("The timeout for waiting the flink rest 
client to return.");
+
+    /** Migrate config keys still prefixed with the old Kubernetes operator 
prefix. */
+    public static Configuration migrateOldConfigKeys(Configuration config) {
+        Preconditions.checkNotNull(config);
+        Set<String> allKeys = config.keySet();
+        config = new Configuration(config);
+        for (String key : allKeys) {
+            if (key.startsWith(LEGACY_CONF_PREFIX)) {
+                String migratedKey = 
key.substring(LEGACY_CONF_PREFIX.length());
+                if (!config.containsKey(migratedKey)) {
+                    String migratedValue = config.getString(key, null);

Review Comment:
   Just a mark for removing the `@Depreated` for `getString(String key, String 
defaultValue)`, please ignore it for code review.
   
   Here is a 
[thread](https://lists.apache.org/thread/zzsf7glfcdjcjm1hfo1xdwc6jp37nb3m) to 
discuss removing `@Depreated` for `public String getString(String key, String 
defaultValue)` of `Configuration`.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to