You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2020/01/22 11:19:47 UTC

[GitHub] [knox] smolnar82 opened a new pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level

smolnar82 opened a new pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242
 
 
   ## What changes were proposed in this pull request?
   
   TODO: change description
   
   ## How was this patch tested?
   
   JUnit:
   ```
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time: 19:24 min (Wall Clock)
   [INFO] Finished at: 2020-01-22T11:48:12+01:00
   [INFO] Final Memory: 421M/2351M
   [INFO] ------------------------------------------------------------------------
   ```
   
   TODO: Manual testing description

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] smolnar82 commented on issue #242: [WIP] KNOX-2190 - Processing advanced service discovery configuration on topology level

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on issue #242: [WIP] KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242#issuecomment-577219635
 
 
   Please hold off with reviews; CM does not support the same `configName` attribute for different parameters. This means `AdvancedServiceDiscoveryConfig.isServiceEnabled(String)` and `AdvancedServiceDiscoveryConfig.getEnabledServiceNames()` should be changed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242#discussion_r369648281
 
 

 ##########
 File path: gateway-cm-integration/src/main/java/org/apache/knox/gateway/cm/descriptor/ClouderaManagerDescriptorMonitor.java
 ##########
 @@ -61,25 +63,25 @@ public ClouderaManagerDescriptorMonitor(GatewayConfig gatewayConfig, ClouderaMan
 
   public void setupMonitor() {
     if (monitoringInterval > 0) {
-      executorService.scheduleAtFixedRate(() -> monitorClouderaManagerDescriptors(false), 0, monitoringInterval, TimeUnit.MILLISECONDS);
+      executorService.scheduleAtFixedRate(() -> monitorClouderaManagerDescriptors(null), 0, monitoringInterval, TimeUnit.MILLISECONDS);
 
 Review comment:
   Passing in `null` explicitly seems wrong...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242#discussion_r369648025
 
 

 ##########
 File path: gateway-cm-integration/src/main/java/org/apache/knox/gateway/cm/descriptor/ClouderaManagerDescriptorParser.java
 ##########
 @@ -121,9 +139,9 @@ private SimpleDescriptor parseXmlDescriptor(String name, String xmlValue) {
           break;
         }
       }
-      if (advancedServiceDiscoveryConfig.getExpectedTopologyNames().contains(name)) {
-        setDiscoveryDetails(descriptor);
-        addEnabledServices(descriptor);
+      if (advancedServiceDiscoveryConfigMap.containsKey(name)) {
+        setDiscoveryDetails(descriptor, advancedServiceDiscoveryConfigMap.get(name));
+        addEnabledServices(descriptor, advancedServiceDiscoveryConfigMap.get(name));
 
 Review comment:
   Nit: You could pull the name out as a variable and check if its null or not to avoid multiple map lookups.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] smolnar82 merged pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level

Posted by GitBox <gi...@apache.org>.
smolnar82 merged pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [knox] risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level

Posted by GitBox <gi...@apache.org>.
risdenk commented on a change in pull request #242: KNOX-2190 - Processing advanced service discovery configuration on topology level
URL: https://github.com/apache/knox/pull/242#discussion_r369648749
 
 

 ##########
 File path: gateway-cm-integration/src/main/java/org/apache/knox/gateway/topology/discovery/advanced/AdvancedServiceDiscoveryConfig.java
 ##########
 @@ -46,16 +46,17 @@ public AdvancedServiceDiscoveryConfig(Properties properties) {
   }
 
   public boolean isServiceEnabled(String serviceName) {
-    return Boolean.valueOf(getPropertyIgnoreCase(PARAMETER_NAME_PREFIX_ENABLED_SERVICE + serviceName, "true"));
+    final String propertyName = PARAMETER_NAME_PREFIX_ENABLED_SERVICE + getTopologyName() + PARAMETER_NAME_POSTFIX_ENABLED_SERVICE + serviceName;
+    return Boolean.valueOf(getPropertyIgnoreCase(propertyName, "true"));
   }
 
   public Set<String> getEnabledServiceNames() {
     return properties.entrySet().stream().filter(keyValuePair -> Boolean.valueOf((String) keyValuePair.getValue()))
-        .map(keyValuePair -> ((String) keyValuePair.getKey()).substring(PARAMETER_NAME_PREFIX_ENABLED_SERVICE.length()).toUpperCase(Locale.getDefault())).collect(toSet());
+        .map(keyValuePair -> ((String) keyValuePair.getKey()).substring(((String) keyValuePair.getKey()).lastIndexOf(".") + 1).toUpperCase(Locale.getDefault())).collect(toSet());
 
 Review comment:
   I think you can use a character here `'.'` instead, but no big deal.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services