This is an automated email from the ASF dual-hosted git repository.
fanng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 6b5ab958f [#5697] feat(core): Fix unexpected warning in
AuxiliaryServiceManager (#5800)
6b5ab958f is described below
commit 6b5ab958f2348c6007dc7776c0c6218fd1f10413
Author: TengYao Chi <[email protected]>
AuthorDate: Mon Dec 9 21:11:31 2024 +0800
[#5697] feat(core): Fix unexpected warning in AuxiliaryServiceManager
(#5800)
### What changes were proposed in this pull request?
Adding a filter operator to filter out gravitino.auxService.names.
### Why are the changes needed?
Currently it will lead to unexpected warning which is confusing.
Fix: #5697
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Test locally
---
.../auxiliary/AuxiliaryServiceManager.java | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git
a/core/src/main/java/org/apache/gravitino/auxiliary/AuxiliaryServiceManager.java
b/core/src/main/java/org/apache/gravitino/auxiliary/AuxiliaryServiceManager.java
index 3e37b35f2..e6e3ac159 100644
---
a/core/src/main/java/org/apache/gravitino/auxiliary/AuxiliaryServiceManager.java
+++
b/core/src/main/java/org/apache/gravitino/auxiliary/AuxiliaryServiceManager.java
@@ -234,18 +234,17 @@ public class AuxiliaryServiceManager {
.getOrDefault(AUX_SERVICE_NAMES, "");
Map<String, String> serviceConfigs = new HashMap<>();
serviceConfigs.put(AUX_SERVICE_NAMES, auxServiceNames);
- config
- .getAllConfig()
+ config.getAllConfig().entrySet().stream()
+ .filter(entry -> !entry.getKey().equals(GRAVITINO_AUX_SERVICE_PREFIX +
AUX_SERVICE_NAMES))
+ .filter(entry ->
entry.getKey().startsWith(GRAVITINO_AUX_SERVICE_PREFIX))
.forEach(
- (k, v) -> {
- if (k.startsWith(GRAVITINO_AUX_SERVICE_PREFIX)) {
- String extractKey =
k.substring(GRAVITINO_AUX_SERVICE_PREFIX.length());
- LOG.warn(
- "The configuration {} is deprecated(still working), please
use gravitino.{} instead.",
- k,
- extractKey);
- serviceConfigs.put(extractKey, v);
- }
+ entry -> {
+ String extractKey =
entry.getKey().substring(GRAVITINO_AUX_SERVICE_PREFIX.length());
+ LOG.warn(
+ "The configuration {} is deprecated(still working), please
use gravitino.{} instead.",
+ entry.getKey(),
+ extractKey);
+ serviceConfigs.put(extractKey, entry.getValue());
});
splitter
.omitEmptyStrings()