FANNG1 commented on code in PR #4005:
URL: https://github.com/apache/gravitino/pull/4005#discussion_r1686639022
##########
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:
1. will use separate PR to add document
2. done
--
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]