[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-15 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366885788
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
 ##
 @@ -240,6 +240,9 @@
   /* property that specifies list of services for which we need to append 
service name to the X-Forward-Context header */
   public static final String X_FORWARD_CONTEXT_HEADER_APPEND_SERVICES = 
GATEWAY_CONFIG_FILE_PREFIX + ".xforwarded.header.context.append.servicename";
 
+  private static final String CLOUDERA_MANAGER_DESCRIPTORS_MONITOR_INTERVAL = 
GATEWAY_CONFIG_FILE_PREFIX + ".cloudera.manager.descriptos.monitor.interval";
 
 Review comment:
   typo: "descriptos"


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-15 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366889933
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##
 @@ -906,8 +901,8 @@ public void onFileChange(File file) {
 public boolean accept(File file) {
   boolean accept = false;
   if (!file.isDirectory() && file.canRead()) {
-String fileName = file.getName();
-if (isDescriptorFile(fileName) || isXmlTypeDescriptorFile(fileName)) {
+String extension = FilenameUtils.getExtension(file.getName());
+if (SUPPORTED_EXTENSIONS.contains(extension)) {
 
 Review comment:
   Did you remove the isDescriptorFile(String) method? It didn't appear to be 
the case.


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-14 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366515550
 
 

 ##
 File path: 
gateway-cm-integration/src/main/java/org/apache/knox/gateway/descriptor/xml/XmlDescriptorParser.java
 ##
 @@ -0,0 +1,182 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.descriptor.xml;
 
 Review comment:
   I think I would prefer the package to reflect the CM-specific nature of this 
descriptor. i.e., org.apache.knox.gateway.descriptor.cm
   In reality, this format is not for a single descriptor like the others, so 
treating it like the XML equivalent of the other formats is an error IMO.


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-14 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366516325
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##
 @@ -790,33 +792,30 @@ private static boolean writeConfig(File dest, String 
name, String content) {
   /**
* Change handler for simple descriptors
*/
-  public static class DescriptorsMonitor extends FileAlterationListenerAdaptor
-  implements FileFilter {
+  public static class DescriptorsMonitor extends FileAlterationListenerAdaptor 
implements FileFilter {
 
-static final List SUPPORTED_EXTENSIONS = new ArrayList<>();
-static {
-  SUPPORTED_EXTENSIONS.add("json");
-  SUPPORTED_EXTENSIONS.add("yml");
-  SUPPORTED_EXTENSIONS.add("yaml");
-}
+static final List SUPPORTED_EXTENSIONS = Arrays.asList("json", 
"yml", "yaml");
 
 private GatewayConfig gatewayConfig;
-
 private File topologiesDir;
-
 private AliasService aliasService;
-
+private final TopologyService topologyService;
 private Map> providerConfigReferences = new 
HashMap<>();
 
 
 static boolean isDescriptorFile(String filename) {
   return 
SUPPORTED_EXTENSIONS.contains(FilenameUtils.getExtension(filename));
 }
 
-public DescriptorsMonitor(GatewayConfig config, File topologiesDir, 
AliasService aliasService) {
+static boolean isXmlTypeDescriptorFile(String fileName) {
+  return "xml".equals(FilenameUtils.getExtension(fileName));
 
 Review comment:
   I might even argue that the CM descriptor extension should be **cm** or 
something other than the generic **xml**.


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-14 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366519274
 
 

 ##
 File path: 
gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptor.java
 ##
 @@ -31,15 +34,19 @@
 
 String getDiscoveryPasswordAlias();
 
-String getClusterName();
+String getCluster();
 
 String getProviderConfig();
 
 List getServices();
 
+Service getService(String serviceName);
+
 List getApplications();
 
+Application getApplication(String applicationName);
 
 Review comment:
   What are Applications here?


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


With regards,
Apache Git Services


[GitHub] [knox] pzampino commented on a change in pull request #236: KNOX-2160 - Introducing Hadoop XML type descriptor format

2020-01-14 Thread GitBox
pzampino commented on a change in pull request #236: KNOX-2160 - Introducing 
Hadoop XML type descriptor format
URL: https://github.com/apache/knox/pull/236#discussion_r366518075
 
 

 ##
 File path: 
gateway-server/src/main/java/org/apache/knox/gateway/services/topology/impl/DefaultTopologyService.java
 ##
 @@ -901,8 +906,8 @@ public void onFileChange(File file) {
 public boolean accept(File file) {
   boolean accept = false;
   if (!file.isDirectory() && file.canRead()) {
-String extension = FilenameUtils.getExtension(file.getName());
-if (SUPPORTED_EXTENSIONS.contains(extension)) {
+String fileName = file.getName();
+if (isDescriptorFile(fileName) || isXmlTypeDescriptorFile(fileName)) {
 
 Review comment:
   I thought there was going to be a separate monitor for this CM integration 
descriptor, the handling of which would be contained in the cm-integration 
module.


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


With regards,
Apache Git Services