KNOX-1411 - WEBHBASE service discovery references incorrect property for the port
authorPhil Zampino <pzampino@apache.org>
Wed, 1 Aug 2018 15:04:17 +0000 (11:04 -0400)
committerPhil Zampino <pzampino@apache.org>
Wed, 1 Aug 2018 15:04:17 +0000 (11:04 -0400)
gateway-discovery-ambari/src/main/resources/ambari-service-discovery-url-mappings.xml
gateway-discovery-ambari/src/test/java/org/apache/knox/gateway/topology/discovery/ambari/AmbariDynamicServiceURLCreatorTest.java

index a41bbed..3653ba1 100644 (file)
     </service>
 
     <service name="WEBHBASE">
-        <url-pattern>http://{HOST}:{MASTER_PORT}</url-pattern>
+        <url-pattern>http://{HOST}:{REST_PORT}</url-pattern>
         <properties>
             <property name="HOST">
                 <component>HBASE_MASTER</component>
                 <hostname/>
             </property>
-            <property name="MASTER_PORT">
+            <property name="REST_PORT">
                 <component>HBASE_MASTER</component>
-                <config-property>hbase.master.info.port</config-property>
+                <config-property>hbase.rest.port</config-property>
             </property>
         </properties>
     </service>
index 96d8622..9660a84 100644 (file)
@@ -325,13 +325,17 @@ public class AmbariDynamicServiceURLCreatorTest {
     private void testWebHBaseURL(Object mappingConfiguration) throws Exception {
         final String[] HOSTNAMES = {"host2", "host4"};
         final String HBASE_MASTER_PORT_PROPERTY = "hbase.master.info.port";
+        final String HBASE_REST_PORT_PROPERTY = "hbase.rest.port";
 
         AmbariComponent hbaseMaster = EasyMock.createNiceMock(AmbariComponent.class);
         Map<String, String> hbaseMasterConfig = new HashMap<>();
-        hbaseMasterConfig.put(HBASE_MASTER_PORT_PROPERTY, "60080");
+        hbaseMasterConfig.put(HBASE_MASTER_PORT_PROPERTY, "60088");
+        hbaseMasterConfig.put(HBASE_REST_PORT_PROPERTY, "60080");
         EasyMock.expect(hbaseMaster.getConfigProperties()).andReturn(hbaseMasterConfig).anyTimes();
         EasyMock.expect(hbaseMaster.getConfigProperty(HBASE_MASTER_PORT_PROPERTY))
                 .andReturn(hbaseMasterConfig.get(HBASE_MASTER_PORT_PROPERTY)).anyTimes();
+        EasyMock.expect(hbaseMaster.getConfigProperty(HBASE_REST_PORT_PROPERTY))
+                .andReturn(hbaseMasterConfig.get(HBASE_REST_PORT_PROPERTY)).anyTimes();
         List<String> hbaseMasterHosts = Arrays.asList(HOSTNAMES);
         EasyMock.expect(hbaseMaster.getHostNames()).andReturn(hbaseMasterHosts).anyTimes();
         EasyMock.replay(hbaseMaster);
@@ -343,7 +347,7 @@ public class AmbariDynamicServiceURLCreatorTest {
         // Run the test
         AmbariDynamicServiceURLCreator builder = newURLCreator(cluster, mappingConfiguration);
         List<String> urls = builder.create("WEBHBASE", null);
-        validateServiceURLs(urls, HOSTNAMES, "http", hbaseMasterConfig.get(HBASE_MASTER_PORT_PROPERTY), null);
+        validateServiceURLs(urls, HOSTNAMES, "http", hbaseMasterConfig.get(HBASE_REST_PORT_PROPERTY), null);
     }