Repository: knox Updated Branches: refs/heads/master 689d9bfd6 -> fbd84791e
KNOX-1182 - Removed lingering configuration, which is no longer used for RM-based services Project: http://git-wip-us.apache.org/repos/asf/knox/repo Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/fbd84791 Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/fbd84791 Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/fbd84791 Branch: refs/heads/master Commit: fbd84791e1b90e636d974fd194bd63c47f24e355 Parents: 689d9bf Author: Phil Zampino <[email protected]> Authored: Tue Apr 10 09:40:57 2018 -0400 Committer: Phil Zampino <[email protected]> Committed: Tue Apr 10 09:40:57 2018 -0400 ---------------------------------------------------------------------- .../ambari-service-discovery-url-mappings.xml | 103 ------------------- .../AmbariDynamicServiceURLCreatorTest.java | 48 --------- 2 files changed, 151 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/knox/blob/fbd84791/gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml ---------------------------------------------------------------------- diff --git a/gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml b/gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml index 3f37c0a..213f531 100644 --- a/gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml +++ b/gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml @@ -95,40 +95,6 @@ </properties> </service> - <service name="RESOURCEMANAGER"> - <url-pattern>{SCHEME}://{WEBAPP_ADDRESS}/ws</url-pattern> - <properties> - <property name="WEBAPP_HTTP_ADDRESS"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.resourcemanager.webapp.address</config-property> - </property> - <property name="WEBAPP_HTTPS_ADDRESS"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.resourcemanager.webapp.https.address</config-property> - </property> - <property name="HTTP_POLICY"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.http.policy</config-property> - </property> - <property name="SCHEME"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>https</then> - <else>http</else> - </if> - </config-property> - </property> - <property name="WEBAPP_ADDRESS"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>WEBAPP_HTTPS_ADDRESS</then> - <else>WEBAPP_HTTP_ADDRESS</else> - </if> - </config-property> - </property> - </properties> - </service> - <service name="HIVE"> <url-pattern>{SCHEME}://{HOST}:{PORT}/{PATH}</url-pattern> <properties> @@ -159,40 +125,6 @@ </properties> </service> - <service name="HDFSUI"> <!-- TODO: Custom ServiceURLCreator for this due to NN federation for HDP 3.0--> - <url-pattern>{SCHEME}://{WEBAPP_ADDRESS}</url-pattern> - <properties> - <property name="WEBAPP_HTTP_ADDRESS"> - <component>NAMENODE</component> - <config-property>dfs.namenode.http-address</config-property> - </property> - <property name="WEBAPP_HTTPS_ADDRESS"> - <component>NAMENODE</component> - <config-property>dfs.namenode.https-address</config-property> - </property> - <property name="HTTP_POLICY"> - <component>NAMENODE</component> - <config-property>dfs.http.policy</config-property> - </property> - <property name="SCHEME"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>https</then> - <else>http</else> - </if> - </config-property> - </property> - <property name="WEBAPP_ADDRESS"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>WEBAPP_HTTPS_ADDRESS</then> - <else>WEBAPP_HTTP_ADDRESS</else> - </if> - </config-property> - </property> - </properties> - </service> - <service name="DRUID-COORDINATOR"> <url-pattern>http://{HOST}:{PORT}</url-pattern> <properties> @@ -495,41 +427,6 @@ </properties> </service> - - <service name="YARNUI"> - <url-pattern>{SCHEME}://{YARN_RM_WEBAPP_ADDRESS}</url-pattern> - <properties> - <property name="HTTP_ADDRESS"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.resourcemanager.webapp.address</config-property> - </property> - <property name="HTTPS_ADDRESS"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.resourcemanager.webapp.https.address</config-property> - </property> - <property name="HTTP_POLICY"> - <component>RESOURCEMANAGER</component> - <config-property>yarn.http.policy</config-property> - </property> - <property name="SCHEME"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>https</then> - <else>http</else> - </if> - </config-property> - </property> - <property name="YARN_RM_WEBAPP_ADDRESS"> - <config-property> - <if property="HTTP_POLICY" value="HTTPS_ONLY"> - <then>HTTPS_ADDRESS</then> - <else>HTTP_ADDRESS</else> - </if> - </config-property> - </property> - </properties> - </service> - <service name="JOBHISTORYUI"> <url-pattern>{JOBHISTORY_WEBAPP_ADDRESS}</url-pattern> <properties> http://git-wip-us.apache.org/repos/asf/knox/blob/fbd84791/gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java ---------------------------------------------------------------------- diff --git a/gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java b/gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java index 9f4ea59..2eb706f 100644 --- a/gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java +++ b/gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java @@ -113,54 +113,6 @@ public class AmbariDynamicServiceURLCreatorTest { validateServiceURLs(urls, HOSTNAMES, expectedScheme, HTTP_PORT, HTTP_PATH); } - - @Test - public void testResourceManagerURLFromInternalMapping() throws Exception { - testResourceManagerURL(null); - } - - @Test - public void testResourceManagerURLFromExternalMapping() throws Exception { - testResourceManagerURL(TEST_MAPPING_CONFIG); - } - - private void testResourceManagerURL(Object mappingConfiguration) throws Exception { - - final String HTTP_ADDRESS = "host2:1111"; - final String HTTPS_ADDRESS = "host2:22222"; - - // HTTP - AmbariComponent resman = EasyMock.createNiceMock(AmbariComponent.class); - setResourceManagerComponentExpectations(resman, HTTP_ADDRESS, HTTPS_ADDRESS, "HTTP"); - - AmbariCluster cluster = EasyMock.createNiceMock(AmbariCluster.class); - EasyMock.expect(cluster.getComponent("RESOURCEMANAGER")).andReturn(resman).anyTimes(); - EasyMock.replay(cluster); - - // Run the test - AmbariDynamicServiceURLCreator builder = newURLCreator(cluster, mappingConfiguration); - String url = builder.create("RESOURCEMANAGER", null).get(0); - assertEquals("http://" + HTTP_ADDRESS + "/ws", url); - - // HTTPS - EasyMock.reset(resman); - setResourceManagerComponentExpectations(resman, HTTP_ADDRESS, HTTPS_ADDRESS, "HTTPS_ONLY"); - - // Run the test - url = builder.create("RESOURCEMANAGER", null).get(0); - assertEquals("https://" + HTTPS_ADDRESS + "/ws", url); - } - - private void setResourceManagerComponentExpectations(final AmbariComponent resmanMock, - final String httpAddress, - final String httpsAddress, - final String httpPolicy) { - EasyMock.expect(resmanMock.getConfigProperty("yarn.resourcemanager.webapp.address")).andReturn(httpAddress).anyTimes(); - EasyMock.expect(resmanMock.getConfigProperty("yarn.resourcemanager.webapp.https.address")).andReturn(httpsAddress).anyTimes(); - EasyMock.expect(resmanMock.getConfigProperty("yarn.http.policy")).andReturn(httpPolicy).anyTimes(); - EasyMock.replay(resmanMock); - } - @Test public void testJobTrackerURLFromInternalMapping() throws Exception { testJobTrackerURL(null);
