Gujiawei-Edinburgh commented on code in PR #188:
URL: https://github.com/apache/bifromq/pull/188#discussion_r2514239207


##########
build/build-bifromq-starter/src/main/java/org/apache/bifromq/starter/config/StandaloneConfigConsolidator.java:
##########
@@ -179,4 +237,91 @@ private static ServerSSLContextConfig 
genSelfSignedServerCert() throws Certifica
         sslContextConfig.setKeyFile(selfCert.privateKey().getAbsolutePath());
         return sslContextConfig;
     }
+
+    private static IKVEngineProvider findProvider(String type) {
+        Map<String, IKVEngineProvider> providers = 
BaseHookLoader.load(IKVEngineProvider.class);
+        IKVEngineProvider found = null;
+        for (IKVEngineProvider p : providers.values()) {
+            if (p.type().equalsIgnoreCase(type)) {
+                if (found != null) {
+                    throw new IllegalStateException("Duplicate storage engine 
provider type: " + type);

Review Comment:
   Would it be better to log a warning and ignore the duplicate provider?



##########
build/build-bifromq-starter/src/main/java/org/apache/bifromq/starter/config/StandaloneConfigConsolidator.java:
##########
@@ -179,4 +237,91 @@ private static ServerSSLContextConfig 
genSelfSignedServerCert() throws Certifica
         sslContextConfig.setKeyFile(selfCert.privateKey().getAbsolutePath());
         return sslContextConfig;
     }
+
+    private static IKVEngineProvider findProvider(String type) {
+        Map<String, IKVEngineProvider> providers = 
BaseHookLoader.load(IKVEngineProvider.class);
+        IKVEngineProvider found = null;
+        for (IKVEngineProvider p : providers.values()) {
+            if (p.type().equalsIgnoreCase(type)) {
+                if (found != null) {
+                    throw new IllegalStateException("Duplicate storage engine 
provider type: " + type);

Review Comment:
   Would it be better to log a warning and ignore the duplicate providers?



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