wu-sheng commented on a change in pull request #4514: Add selector property in 
application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392654436
 
 

 ##########
 File path: 
oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +109,26 @@ private void 
overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Map<String, Object>> 
moduleConfiguration) {
+        final Set<String> modulesWithoutProvider = new HashSet<>();
+        for (final Map.Entry<String, Map<String, Object>> entry : 
moduleConfiguration.entrySet()) {
+            final String moduleName = entry.getKey();
+            final Map<String, Object> providerConfig = entry.getValue();
+            if (providerConfig.containsKey("selector")) {
+                final String selector = (String) 
providerConfig.get("selector");
+                final String resolvedSelector = 
PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                    selector, System.getProperties()
+                );
+                providerConfig.entrySet().removeIf(e -> 
!resolvedSelector.equals(e.getKey()));
 
 Review comment:
   @kezhenxu94 To be more clear,  after this remove, it could be no provider 
available, we should check and report error immidiately.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to