jerryshao commented on code in PR #4005:
URL: https://github.com/apache/gravitino/pull/4005#discussion_r1686476171


##########
core/src/main/java/org/apache/gravitino/auxiliary/AuxiliaryServiceManager.java:
##########
@@ -219,4 +222,43 @@ public void serviceStop() throws Exception {
       throw firstException;
     }
   }
+
+  // Extract aux service configs, transform gravitino.$serviceName.key to 
$serviceName.key.
+  // And will transform gravitino.auxService.$serviceName.key to 
$serviceName.key to keep
+  // compatibility.
+  @VisibleForTesting
+  static Map<String, String> extractAuxiliaryServiceConfigs(Config config) {
+    String auxServiceNames =
+        config
+            .getConfigsWithPrefix(GRAVITINO_AUX_SERVICE_PREFIX)
+            .getOrDefault(AUX_SERVICE_NAMES, "");
+    Map<String, String> serviceConfigs = new HashMap<>();
+    serviceConfigs.put(AUX_SERVICE_NAMES, auxServiceNames);
+    config
+        .getAllConfig()
+        .forEach(
+            (k, v) -> {
+              if (k.startsWith(GRAVITINO_AUX_SERVICE_PREFIX)) {
+                
serviceConfigs.put(k.substring(GRAVITINO_AUX_SERVICE_PREFIX.length()), v);
+              }
+            });
+    splitter
+        .omitEmptyStrings()
+        .trimResults()
+        .splitToStream(auxServiceNames)
+        .forEach(
+            name ->
+                config.getAllConfig().forEach((k, v) -> 
extractConfig(serviceConfigs, name, k, v)));
+    return serviceConfigs;
+  }

Review Comment:
   I think you should:
   
   1. Update the server config doc to describe the new config names and declare 
that old keys are still workable.
   2. Here in the code, when old configs are configured, output a warn log to 
users.



-- 
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