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


##########
core/src/test/java/org/apache/gravitino/auxiliary/TestAuxiliaryServiceManager.java:
##########
@@ -88,4 +110,36 @@ public void testGravitinoAuxServiceManager() throws 
Exception {
     verify(auxService, times(1)).serviceStop();
     verify(auxService2, times(1)).serviceStop();
   }
+
+  @Test
+  void testAuxiliaryServiceConfigs() {
+    Map<String, String> m =
+        ImmutableMap.of(
+            AuxiliaryServiceManager.GRAVITINO_AUX_SERVICE_PREFIX
+                + AuxiliaryServiceManager.AUX_SERVICE_NAMES,
+            "a,b",
+            "gravitino.a.test1",
+            "test1",
+            AuxiliaryServiceManager.GRAVITINO_AUX_SERVICE_PREFIX + "a.test4",
+            "test4",
+            "gravitino.b.test2",
+            "test2",
+            "gravitino.aa.test3",
+            "test3");
+    DummyConfig config = new DummyConfig();
+    config.loadFromMap(m, k -> true);
+    Map<String, String> serviceConfigs =
+        AuxiliaryServiceManager.extractAuxiliaryServiceConfigs(config);
+    Assertions.assertEquals(
+        ImmutableMap.of(
+            AuxiliaryServiceManager.AUX_SERVICE_NAMES,
+            "a,b",
+            "a.test1",
+            "test1",
+            "a.test4",
+            "test4",
+            "b.test2",
+            "test2"),
+        serviceConfigs);

Review Comment:
   I think you should honor overwrite mechanism, not throw an exception, I 
think throwing an exception is too severe, just adding warning logs and using 
new to overwrite old should be enough, what do you think?



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