moresandeep commented on code in PR #1178:
URL: https://github.com/apache/knox/pull/1178#discussion_r2961548101


##########
gateway-service-definitions/src/main/resources/services/yarnsui/1.0.0/rewrite.xml:
##########
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   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.
+-->
+<rules>
+  <rule dir="IN" name="YARN-SCHEDULER-UI/yarn-scheduler-ui/inbound/root" 
pattern="*://*:*/**/yarn-scheduler-ui/">

Review Comment:
   We have a unwritten rule where service name (YARN-SCHEDULER-UI) should be 
the same as the folder name (yarnsui) It helps to identify the service files 
easily while debugging. 
   
   Can you update the folder name to YARN-SCHEDULER-UI?



##########
gateway-service-definitions/src/main/resources/services/yarnsui/1.0.0/service.xml:
##########
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+   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.
+-->
+
+<service role="YARNSUI" name="yarnsui" version="1.0.0">
+    <metadata>
+        <type>UI</type>
+        <context>/yarnsui/</context>
+        <shortDesc>YARN Scheduler UI</shortDesc>
+        <description>YARN Scheduler UI</description>
+    </metadata>
+    <routes>
+        <route path="/yarnsui/">
+            <rewrite apply="YARNSUI/yarnsui/inbound/root" to="request.url"/>
+            <rewrite apply="YARNSUI/yarnsui/outbound/headers/location/filter" 
to="response.headers"/>
+            <rewrite apply="YARNSUI/yarnsui/outbound/index" to="response.body" 
/>
+        </route>
+
+        <route path="/yarnsui/**">
+            <rewrite apply="YARNSUI/yarnsui/inbound/path" to="request.url"/>
+            <rewrite apply="YARNSUI/yarnsui/outbound/headers/location/filter" 
to="response.headers"/>
+            <rewrite apply="YARNSUI/yarnsui/outbound/index" 
to="response.body"/>
+        </route>
+
+        <route path="/yarnsui/ws/v1/cluster/**?**">
+            <rewrite apply="YARNSUI/yarnsui/inbound/ws-cluster-query" 
to="request.url"/>
+        </route>
+
+        <route path="/yarnsui/ws/v1/cluster/**">
+            <rewrite apply="YARNSUI/yarnsui/inbound/ws-cluster" 
to="request.url"/>
+        </route>
+
+        <route path="/yarnsui/conf?**">
+            <rewrite apply="YARNSUI/yarnsui/inbound/conf-query" 
to="request.url"/>
+        </route>
+    </routes>
+
+    <dispatch classname="org.apache.knox.gateway.dispatch.DefaultDispatch" 
ha-classname="org.apache.knox.gateway.rm.dispatch.RMUI2HaDispatch"/>

Review Comment:
   Also, please use the `ConfigurableHADispatch.java` and  
`ConfigurableDispatch.java` they extent the older DefaultDispatch and offer 
more customizations.



##########
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/yarn/YarnSUIServiceModelGenerator.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.topology.discovery.cm.model.yarn;
+
+public class YarnSUIServiceModelGenerator extends YarnUIServiceModelGenerator {

Review Comment:
   I would also recommend to update the class name from 
`YarnSUIServiceModelGenerator` to something that is more descriptive of the 
service.



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