You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2013/09/20 22:11:40 UTC

[1/2] KNOX-142: Change everything from templeton to webhcat

Updated Branches:
  refs/heads/master e338fe64f -> 9567e7c05


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
new file mode 100644
index 0000000..f39912d
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
@@ -0,0 +1,166 @@
+/**
+ * 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.hadoop.gateway.hdfs;
+
+import org.apache.hadoop.gateway.deploy.DeploymentContext;
+import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
+import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
+import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
+import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
+import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptorFactory;
+import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter;
+import org.apache.hadoop.gateway.topology.Service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBase {
+
+  private static final String RULES_RESOURCE = WebHdfsDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
+  private static final String WEBHDFS_EXTERNAL_PATH = "/namenode/api/v1";
+  private static final String DATANODE_EXTERNAL_PATH = "/datanode/api/v1";
+//  private static final String WEBHDFS_INTERNAL_PATH = "/webhdfs";
+//  private static final String CLUSTER_URL_FUNCTION = "{gateway.url}";
+
+  @Override
+  public String getRole() {
+    return "WEBHDFS";
+  }
+
+  @Override
+  public String getName() {
+    return "webhdfs";
+  }
+
+  @Override
+  public void contributeService( DeploymentContext context, Service service ) throws Exception {
+    contributeRewriteRules( context, service );
+    contributeNameNodeResource( context, service );
+    contributeDataNodeResource( context, service );
+  }
+
+  private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException, IOException {
+    UrlRewriteRulesDescriptor serviceRules = loadRulesFromClassPath();
+    UrlRewriteRulesDescriptor clusterRules = context.getDescriptor( "rewrite" );
+    clusterRules.addRules( serviceRules );
+
+//    UrlRewriteRulesDescriptor rules = context.getDescriptor( "rewrite" );
+//    UrlRewriteRuleDescriptor rule;
+//    UrlRewriteActionRewriteDescriptorExt rewrite;
+//    UrlRewriteMatchDescriptor match;
+//
+//    rule = rules.addRule( getQualifiedName() + "/namenode/root/inbound" )
+//        .directions( "inbound" )
+//        .pattern( "*://*:*/**" + WEBHDFS_EXTERNAL_PATH + "/?{**}" );
+//    rewrite = rule.addStep( "rewrite" );
+//    //rewrite.template( service.getUrl().toExternalForm() + "/?user.name={$username}&{**}" );
+//    rewrite.template( service.getUrl() + "/?{**}" );
+//
+//    rule = rules.addRule( getQualifiedName() + "/namenode/file/inbound" )
+//        .directions( "inbound" )
+//        .pattern( "*://*:*/**" + WEBHDFS_EXTERNAL_PATH + "/{path=**}?{**}" );
+//    rewrite = rule.addStep( "rewrite" );
+//    //rewrite.template( service.getUrl().toExternalForm() + "/{path=**}?user.name={$username}&{**}" );
+//    rewrite.template( service.getUrl() + "/{path=**}?{**}" );
+//
+//    rule = rules.addRule( getQualifiedName() + "/datanode/inbound" )
+//        .directions( "inbound" )
+//        .pattern( "*://*:*/**" + DATANODE_EXTERNAL_PATH + "/{path=**}?**" );
+//    //TODO: If the input type is wrong it throws a NPE.
+//    rule.addStep( "decode-query" );
+//    match = rule.addStep( "match" );
+//    match.pattern( "*://*:*/**" + DATANODE_EXTERNAL_PATH + "/{path=**}?{host}&{port}&{**}" );
+//    rewrite = rule.addStep( "rewrite" );
+//    rewrite.template( "http://{host}:{port}/{path=**}?{**}" );
+//
+//    rule = rules.addRule( getQualifiedName() + "/datanode/outbound" )
+//        .directions( "outbound" );
+//    match = rule.addStep( "match" );
+//    match.pattern( "*://{host}:{port}/{path=**}?{**}" );
+//    rewrite = rule.addStep( "rewrite" );
+//    rewrite.template( CLUSTER_URL_FUNCTION + DATANODE_EXTERNAL_PATH + "/{path=**}?host={$hostmap(host)}&{port}&{**}" );
+//    rule.addStep( "encode-query" );
+//
+//    UrlRewriteFilterDescriptor filter = rules.addFilter( getQualifiedName() + "/outbound" );
+//    UrlRewriteFilterContentDescriptor content = filter.addContent( "application/x-http-headers" );
+//    content.addApply( "Location", getQualifiedName() + "/datanode/outbound" );
+  }
+
+  public void contributeNameNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
+    List<FilterParamDescriptor> params;
+    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
+    rootResource.role( service.getRole() );
+    rootResource.pattern( WEBHDFS_EXTERNAL_PATH + "/?**" );
+    addAuthenticationFilter( context, service, rootResource );
+    params = new ArrayList<FilterParamDescriptor>();
+    params.add( rootResource.createFilterParam().
+        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/root" ) );
+    addRewriteFilter( context, service, rootResource, params );
+    addIdentityAssertionFilter( context, service, rootResource );
+    addAuthorizationFilter( context, service, rootResource );
+    addDispatchFilter( context, service, rootResource, "dispatch", null );
+
+    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
+    fileResource.role( service.getRole() );
+    fileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/**?**" );
+    addAuthenticationFilter( context, service, fileResource );
+    params = new ArrayList<FilterParamDescriptor>();
+    params.add( fileResource.createFilterParam().
+        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/file" ) );
+    params.add( fileResource.createFilterParam().
+        name( UrlRewriteServletFilter.RESPONSE_HEADERS_FILTER_PARAM ).value( getQualifiedName() + "/outbound/namenode/headers" ) );
+    addRewriteFilter( context, service, fileResource, params );
+    addIdentityAssertionFilter( context, service, fileResource );
+    addAuthorizationFilter( context, service, fileResource );
+    addDispatchFilter( context, service, fileResource, "dispatch", null );
+  }
+
+  public void contributeDataNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
+    List<FilterParamDescriptor> params;
+    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
+    fileResource.role( service.getRole() );
+    fileResource.pattern( DATANODE_EXTERNAL_PATH + "/**?**" );
+    addAuthenticationFilter( context, service, fileResource );
+    addIdentityAssertionFilter( context, service, fileResource );
+    addAuthorizationFilter( context, service, fileResource );
+    params = new ArrayList<FilterParamDescriptor>();
+    params.add( fileResource.createFilterParam().
+        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/datanode" ) );
+    addRewriteFilter( context, service, fileResource, params );
+    addDispatchFilter( context, service, fileResource, "dispatch", null );
+  }
+
+  String getQualifiedName() {
+    return getRole() + "/" + getName();
+  }
+
+  UrlRewriteRulesDescriptor loadRulesFromClassPath() throws IOException {
+    InputStream stream = this.getClass().getClassLoader().getResourceAsStream( RULES_RESOURCE );
+    Reader reader = new InputStreamReader( stream );
+    UrlRewriteRulesDescriptor rules = UrlRewriteRulesDescriptorFactory.load( "xml", reader );
+    reader.close();
+    stream.close();
+    return rules;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
new file mode 100644
index 0000000..0a3d6ee
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
@@ -0,0 +1,21 @@
+##########################################################################
+# 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.
+##########################################################################
+
+org.apache.hadoop.gateway.hdfs.WebHdfsDeploymentContributor
+org.apache.hadoop.gateway.hdfs.NameNodeDeploymentContributor
+org.apache.hadoop.gateway.hdfs.JobTrackerDeploymentContributor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml b/gateway-service-webhdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
new file mode 100644
index 0000000..d0bd2e2
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
@@ -0,0 +1,62 @@
+<?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="OUT" name="WEBHDFS/webhdfs/outbound" pattern="hdfs://*:*/{path=**}?{**}">
+        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
+    </rule>
+
+    <rule dir="OUT" name="WEBHDFS/webhdfs/outbound" pattern="webhdfs://*:*/{path=**}?{**}">
+        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
+    </rule>
+
+    <rule dir="OUT" name="WEBHDFS/webhdfs/outbound/namenode/headers/location">
+        <match pattern="{scheme}://{host}:{port}/{path=**}?{**}"/>
+        <rewrite template="{gateway.url}/datanode/api/v1/{path=**}?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
+        <encrypt-query/>
+    </rule>
+
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/hdfs" pattern="hdfs:/{path=**}?{**}">
+        <rewrite template="{$serviceMappedUrl[NAMENODE]}/{path=**}?{**}"/>
+    </rule>
+
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/webhdfs" pattern="webhdfs:/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[WEBHDFS]}/{path=**}?{**}"/>
+    </rule>
+
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/**/namenode/api/{version}/?{**}">
+        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/?{**}"/>
+    </rule>
+
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/file" pattern="*://*:*/**/namenode/api/{version}/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/{path=**}?{**}"/>
+    </rule>
+
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/datanode">
+        <decrypt-query/>
+        <match pattern="*://*:*/**/datanode/api/*/{path=**}?{scheme}?{host}?{port}?{**}"/>
+        <rewrite template="{scheme}://{host}:{port}/{path=**}?{**}"/>
+    </rule>
+
+    <filter name="WEBHDFS/webhdfs/outbound/namenode/headers">
+        <content type="application/x-http-headers">
+            <apply path="Location" rule="WEBHDFS/webhdfs/outbound/namenode/headers/location"/>
+        </content>
+    </filter>
+
+</rules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java
index eb74e52..5dca126 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/job/Job.java
@@ -21,7 +21,7 @@ import org.apache.hadoop.gateway.shell.Hadoop;
 
 public class Job {
 
-  static String SERVICE_PATH = "/templeton/api/v1";
+  static String SERVICE_PATH = "/webhcat/api/v1";
 
   public static Java.Request submitJava( Hadoop session ) {
     return new Java.Request( session );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
index a43ff2e..4e7ad11 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
@@ -121,7 +121,7 @@ public class GatewayBasicFuncTest {
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );
     driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/datanode/api", USE_MOCK_SERVICES );
     driver.setupService( "JOBTRACKER", "thrift://" + TEST_HOST + ":8021", null, USE_MOCK_SERVICES );
-    driver.setupService( "TEMPLETON", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton/api", USE_MOCK_SERVICES );
+    driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/webhcat", "/cluster/webhcat/api", USE_MOCK_SERVICES );
     driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie/api", USE_MOCK_SERVICES );
     driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive/api/v1", USE_MOCK_SERVICES );
     driver.setupService( "STARGATE", "http://" + TEST_HOST + ":2707", "/cluster/hbase/api/v1", USE_MOCK_SERVICES );
@@ -195,8 +195,8 @@ public class GatewayBasicFuncTest {
             .addTag( "role" ).addText( "JOBTRACKER" )
             .addTag( "url" ).addText( driver.getRealUrl( "JOBTRACKER" ) ).gotoParent()
           .addTag( "service" )
-            .addTag( "role" ).addText( "TEMPLETON" )
-            .addTag( "url" ).addText( driver.getRealUrl( "TEMPLETON" ) ).gotoParent()
+            .addTag( "role" ).addText( "WEBHCAT" )
+            .addTag( "url" ).addText( driver.getRealUrl( "WEBHCAT" ) ).gotoParent()
           .addTag( "service" )
             .addTag( "role" ).addText( "OOZIE" )
             .addTag( "url" ).addText( driver.getRealUrl( "OOZIE" ) ).gotoParent()
@@ -660,8 +660,8 @@ public class GatewayBasicFuncTest {
   }
 
   @Test
-  public void testJavaMapReduceViaTempleton() throws IOException {
-    String root = "/tmp/GatewayWebHdfsFuncTest/testJavaMapReduceViaTempleton";
+  public void testJavaMapReduceViaWebHCat() throws IOException {
+    String root = "/tmp/GatewayWebHdfsFuncTest/testJavaMapReduceViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
     String group = "mapred";
@@ -688,7 +688,7 @@ public class GatewayBasicFuncTest {
     driver.createDir( user, pass, null, root+"/output", "777", 200, 200 );
 
     /* Submit the job
-    curl -d user.name=hdfs -d jar=wordcount/hadoop-examples.jar -d class=org.apache.org.apache.hadoop.examples.WordCount -d arg=wordcount/input -d arg=wordcount/output 'http://localhost:8888/org.apache.org.apache.hadoop.gateway/cluster/templeton/api/v1/mapreduce/jar'
+    curl -d user.name=hdfs -d jar=wordcount/hadoop-examples.jar -d class=org.apache.org.apache.hadoop.examples.WordCount -d arg=wordcount/input -d arg=wordcount/output 'http://localhost:8888/org.apache.org.apache.hadoop.gateway/cluster/webhcat/api/v1/mapreduce/jar'
     {"id":"job_201210301335_0059"}
     */
     String job = driver.submitJava(
@@ -714,8 +714,8 @@ public class GatewayBasicFuncTest {
   }
 
   @Test
-  public void testPigViaTempleton() throws IOException {
-    String root = "/tmp/GatewayTempletonFuncTest/testPigViaTempleton";
+  public void testPigViaWebHCat() throws IOException {
+    String root = "/tmp/GatewayWebHCatFuncTest/testPigViaWebHCat";
     String user = "mapred";
     String pass = "mapred-password";
     String group = "mapred";
@@ -743,11 +743,11 @@ public class GatewayBasicFuncTest {
   }
 
   @Test
-  public void testHiveViaTempleton() throws IOException {
+  public void testHiveViaWebHCat() throws IOException {
     String user = "hive";
     String pass = "hive-password";
     String group = "hive";
-    String root = "/tmp/GatewayTempletonFuncTest/testHiveViaTempleton";
+    String root = "/tmp/GatewayWebHCatFuncTest/testHiveViaWebHCat";
 
     // Cleanup if previous run failed.
     driver.deleteFile( user, pass, root, "true", 200, 404 );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
index f6336de..0fb91e1 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
@@ -615,7 +615,7 @@ public class GatewayFuncTestDriver {
   }
 
   public String submitJava( String user, String password, String jar, String main, String input, String output, int status ) {
-    getMock( "TEMPLETON" )
+    getMock( "WEBHCAT" )
         .expect()
         .method( "POST" )
         .pathInfo( "/v1/mapreduce/jar" )
@@ -637,7 +637,7 @@ public class GatewayFuncTestDriver {
         .expect()
         //.log().all()
         .statusCode( status )
-        .when().post( getUrl( "TEMPLETON" ) + "/v1/mapreduce/jar" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
+        .when().post( getUrl( "WEBHCAT" ) + "/v1/mapreduce/jar" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
     log.debug( "JOB=" + job );
@@ -646,7 +646,7 @@ public class GatewayFuncTestDriver {
   }
 
   public String submitPig( String user, String password, String group, String file, String arg, String statusDir, int... status ) {
-    getMock( "TEMPLETON" )
+    getMock( "WEBHCAT" )
         .expect()
         .method( "POST" )
         .pathInfo( "/v1/pig" )
@@ -669,7 +669,7 @@ public class GatewayFuncTestDriver {
         .contentType( "application/json" )
         //.content( "boolean", equalTo( true ) )
         .when()
-        .post( getUrl( "TEMPLETON" ) + "/v1/pig" + ( isUseGateway() ? "" : "?user.name=" + user ) )
+        .post( getUrl( "WEBHCAT" ) + "/v1/pig" + ( isUseGateway() ? "" : "?user.name=" + user ) )
         .asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
@@ -679,7 +679,7 @@ public class GatewayFuncTestDriver {
   }
 
   public String submitHive( String user, String password, String group, String file, String statusDir, int... status ) {
-    getMock( "TEMPLETON" )
+    getMock( "WEBHCAT" )
         .expect()
         .method( "POST" )
         .pathInfo( "/v1/hive" )
@@ -701,7 +701,7 @@ public class GatewayFuncTestDriver {
         .contentType( "application/json" )
         //.content( "boolean", equalTo( true ) )
         .when()
-        .post( getUrl( "TEMPLETON" ) + "/v1/hive" + ( isUseGateway() ? "" : "?user.name=" + user ) )
+        .post( getUrl( "WEBHCAT" ) + "/v1/hive" + ( isUseGateway() ? "" : "?user.name=" + user ) )
         .asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
@@ -711,13 +711,13 @@ public class GatewayFuncTestDriver {
   }
 
   public void queryQueue( String user, String password, String job ) throws IOException {
-    getMock( "TEMPLETON" )
+    getMock( "WEBHCAT" )
           .expect()
           .method( "GET" )
           .pathInfo( "/v1/queue/" + job )
           .respond()
           .status( HttpStatus.SC_OK )
-          .content( getResourceBytes( "templeton-job-status.json" ) )
+          .content( getResourceBytes( "webhcat-job-status.json" ) )
           .contentType( "application/json" );
     String status = given()
         //.log().all()
@@ -727,7 +727,7 @@ public class GatewayFuncTestDriver {
         //.log().all()
         .content( "status.jobId", equalTo( job ) )
         .statusCode( HttpStatus.SC_OK )
-        .when().get( getUrl( "TEMPLETON" ) + "/v1/queue/{job}" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
+        .when().get( getUrl( "WEBHCAT" ) + "/v1/queue/{job}" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
     log.debug( "STATUS=" + status );
     assertComplete();
   }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributorTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributorTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributorTest.java
new file mode 100644
index 0000000..8b3303d
--- /dev/null
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributorTest.java
@@ -0,0 +1,45 @@
+/**
+ * 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.hadoop.gateway.webhcat;
+
+import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor;
+import org.junit.Test;
+
+import java.util.Iterator;
+import java.util.ServiceLoader;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
+public class WebHCatDeploymentContributorTest {
+
+  @Test
+  public void testServiceLoader() throws Exception {
+    ServiceLoader loader = ServiceLoader.load( ServiceDeploymentContributor.class );
+    Iterator iterator = loader.iterator();
+    assertThat( "Service iterator empty.", iterator.hasNext() );
+    while( iterator.hasNext() ) {
+      Object object = iterator.next();
+      if( object instanceof WebHCatDeploymentContributor ) {
+        return;
+      }
+    }
+    fail( "Failed to find " + WebHCatDeploymentContributor.class.getName() + " via service loader." );
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/script.pig
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/script.pig b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/script.pig
index df853d4..ce7b638 100644
--- a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/script.pig
+++ b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/script.pig
@@ -1,3 +1,3 @@
-A = load '/tmp/GatewayTempletonFuncText/pig/passwd.txt' using PigStorage(':');
+A = load '/tmp/GatewayWebHCatFuncText/pig/passwd.txt' using PigStorage(':');
 B = foreach A generate $0 as id;
 dump B;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/templeton-job-status.json
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/templeton-job-status.json b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/templeton-job-status.json
deleted file mode 100644
index 32b2949..0000000
--- a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/templeton-job-status.json
+++ /dev/null
@@ -1 +0,0 @@
-{"status":{"startTime":1352414440951,"jobID":{"jtIdentifier":"201210301335","id":86},"jobPriority":"NORMAL","username":"hdfs","failureInfo":"NA","runState":4,"schedulingInfo":"NA","jobId":"job_201210301335_0086","jobACLs":{},"jobComplete":false},"profile":{"url":"http://vm.home:50030/jobdetails.jsp?jobid=job_201210301335_0086","user":"hdfs","jobID":{"jtIdentifier":"201210301335","id":86},"jobName":"TempletonControllerJob","queueName":"default","jobFile":"hdfs://vm.home:8020/user/hdfs/.staging/job_201210301335_0086/job.xml","jobId":"job_201210301335_0086"},"id":"job_201210301335_0086","parentId":null,"percentComplete":null,"exitValue":null,"user":"hdfs","callback":null,"completed":null}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/webhcat-job-status.json
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/webhcat-job-status.json b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/webhcat-job-status.json
new file mode 100644
index 0000000..32b2949
--- /dev/null
+++ b/gateway-test/src/test/resources/org/apache/hadoop/gateway/GatewayBasicFuncTest/webhcat-job-status.json
@@ -0,0 +1 @@
+{"status":{"startTime":1352414440951,"jobID":{"jtIdentifier":"201210301335","id":86},"jobPriority":"NORMAL","username":"hdfs","failureInfo":"NA","runState":4,"schedulingInfo":"NA","jobId":"job_201210301335_0086","jobACLs":{},"jobComplete":false},"profile":{"url":"http://vm.home:50030/jobdetails.jsp?jobid=job_201210301335_0086","user":"hdfs","jobID":{"jtIdentifier":"201210301335","id":86},"jobName":"TempletonControllerJob","queueName":"default","jobFile":"hdfs://vm.home:8020/user/hdfs/.staging/job_201210301335_0086/job.xml","jobId":"job_201210301335_0086"},"id":"job_201210301335_0086","parentId":null,"percentComplete":null,"exitValue":null,"user":"hdfs","callback":null,"completed":null}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/hsso-release/home/INSTALL
----------------------------------------------------------------------
diff --git a/hsso-release/home/INSTALL b/hsso-release/home/INSTALL
index 95c095b..9b44d9e 100644
--- a/hsso-release/home/INSTALL
+++ b/hsso-release/home/INSTALL
@@ -71,7 +71,7 @@ Installation and Deployment Instructions
 5. Configure the Gateway with the topology of your Hadoop cluster
    a. Edit the file {GATEWAY_HOME}/deployments/sample.xml
    b. Change the host and port in the urls of the <service> elements for
-      WEBHDFS, TEMPLETON and OOZIE services to match your Hadoop cluster
+      WEBHDFS, WEBHCAT and OOZIE services to match your Hadoop cluster
       deployment.
    c. The default configuration contains the LDAP URL for a LDAP server.  By
       default that file is configured to access the demo ApacheDS based LDAP
@@ -112,12 +112,12 @@ Installation and Deployment Instructions
      {"accessTime":0,"blockSize":0,"group":"hdfs","length":0,"modificationTime":1350595857178,"owner":"hdfs","pathSuffix":"user","permission":"755","replication":0,"type":"DIRECTORY"}
      ]}}
 
-   For additional information on WebHDFS, Templeton/WebHCat and Oozie
+   For additional information on WebHDFS, WebHCat/Templeton and Oozie
    REST APIs, see the following URLs respectively:
 
    http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html
-   http://people.apache.org/~thejas/templeton_doc_v1/
-   http://oozie.apache.org/docs/3.3.1/WebServicesAPI.html
+   http://hive.apache.org/docs/hcat_r0.5.0/rest.html
+   http://oozie.apache.org/docs/4.0.0/WebServicesAPI.html
 
 ------------------------------------------------------------------------------
 Persisting the Master
@@ -205,21 +205,21 @@ Mapping Gateway URLs to Hadoop cluster URLs
 ------------------------------------------------------------------------------
 The Gateway functions much like a reverse proxy.  As such it maintains a
 mapping of URLs that are exposed externally by the Gateway to URLs that are
-provided by the Hadoop cluster.  Examples of mappings for the NameNode and
-Templeton are shown below.  These mapping are generated from the combination
+provided by the Hadoop cluster.  Examples of mappings for the WebHDFS and
+WebHCat are shown below.  These mapping are generated from the combination
 of the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml)
 and the cluster topology descriptors
 (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
   WebHDFS
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/namenode/api
-    Cluster: http://<namenode-host>:50070/webhdfs
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/webhdfs
+    Cluster: http://<webhdfs-host>:50070/webhdfs
   WebHCat (Templeton)
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api
-    Cluster: http://<templeton-host>:50111/templeton
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/webhcat
+    Cluster: http://<webhcat-host>:50111/templeton
   Oozie
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api
-    Cluster: http://<templeton-host>:11000/oozie
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie
+    Cluster: http://<oozie-host>:11000/oozie
 
 The values for <gateway-host>, <gateway-port>, <gateway-path> are provided via
 the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml).
@@ -227,11 +227,11 @@ the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml).
 The value for <cluster-name> is derived from the name of the cluster topology
 descriptor (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-The value for <namenode-host> and <templeton-host> is provided via the cluster
+The value for <webhdfs-host> and <webhcat-host> is provided via the cluster
 topology descriptor (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-Note: The ports 50070, 50111 and 11000 are the defaults for NameNode,
-      Templeton and Oozie respectively. Their values can also be provided via
+Note: The ports 50070, 50111 and 11000 are the defaults for WebHDFS,
+      WebHCat and Oozie respectively. Their values can also be provided via
       the cluster topology descriptor if your Hadoop cluster uses different
       ports.
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/hsso-release/home/README
----------------------------------------------------------------------
diff --git a/hsso-release/home/README b/hsso-release/home/README
index a3cb194..a2b16ab 100644
--- a/hsso-release/home/README
+++ b/hsso-release/home/README
@@ -41,8 +41,9 @@ specific needs for authentication.
 HTTP BASIC authentication with identity being asserted to the rest of the
 cluster via Pseudo/Simple authentication will be demonstrated for security.
 
-For API aggregation, the Gateway will provide a central endpoint for HDFS,
-Templeton and Oozie APIs for each cluster.
+For API aggregation, the Gateway provides a central endpoint for access to
+WebHDFS, WebHCat/Templeton, Hive, Starbase/HBase, Ambari and Oozie APIs for
+each cluster.
 
 Future Milestone releases will extend these capabilities with additional
 authentication, identity assertion, API aggregation and eventually management

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/hsso-release/home/deployments/sample.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/deployments/sample.xml b/hsso-release/home/deployments/sample.xml
index e399bec..3b15ae4 100644
--- a/hsso-release/home/deployments/sample.xml
+++ b/hsso-release/home/deployments/sample.xml
@@ -35,7 +35,7 @@
         <url>http://localhost:50070/webhdfs</url>
     </service>
     <service>
-        <role>TEMPLETON</role>
+        <role>WEBHCAT</role>
         <url>http://localhost:50111/templeton</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/hsso-release/home/templates/topology.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/templates/topology.xml b/hsso-release/home/templates/topology.xml
index 5eb59f0..15cc546 100644
--- a/hsso-release/home/templates/topology.xml
+++ b/hsso-release/home/templates/topology.xml
@@ -55,7 +55,7 @@
         <url>http://localhost:50070/webhdfs</url>
     </service>
     <service>
-        <role>TEMPLETON</role>
+        <role>WEBHCAT</role>
         <url>http://localhost:50111/templeton</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/hsso-release/pom.xml
----------------------------------------------------------------------
diff --git a/hsso-release/pom.xml b/hsso-release/pom.xml
index caea5cf..4a5bb5b 100644
--- a/hsso-release/pom.xml
+++ b/hsso-release/pom.xml
@@ -115,7 +115,7 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-hdfs</artifactId>
+            <artifactId>gateway-service-webhdfs</artifactId>
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
@@ -123,7 +123,7 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-templeton</artifactId>
+            <artifactId>gateway-service-webhcat</artifactId>
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4b9e8ac..0daf50a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,9 +50,9 @@
         <module>gateway-service-as</module>
         <module>gateway-service-hbase</module>
         <module>gateway-service-hive</module>
-        <module>gateway-service-hdfs</module>
+        <module>gateway-service-webhdfs</module>
         <module>gateway-service-oozie</module>
-        <module>gateway-service-templeton</module>
+        <module>gateway-service-webhcat</module>
         <module>gateway-service-tgs</module>
         <module>gateway-server</module>
         <module>gateway-server-launcher</module>
@@ -374,12 +374,12 @@
             </dependency>
             <dependency>
                 <groupId>${gateway-group}</groupId>
-                <artifactId>gateway-service-hdfs</artifactId>
+                <artifactId>gateway-service-webhdfs</artifactId>
                 <version>${gateway-version}</version>
             </dependency>
             <dependency>
                 <groupId>${gateway-group}</groupId>
-                <artifactId>gateway-service-templeton</artifactId>
+                <artifactId>gateway-service-webhcat</artifactId>
                 <version>${gateway-version}</version>
             </dependency>
             <dependency>


[2/2] git commit: KNOX-142: Change everything from templeton to webhcat

Posted by km...@apache.org.
KNOX-142: Change everything from templeton to webhcat


Project: http://git-wip-us.apache.org/repos/asf/incubator-knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-knox/commit/9567e7c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/9567e7c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/9567e7c0

Branch: refs/heads/master
Commit: 9567e7c05d1db7e65d7e9861bc23cfbb95e16a0a
Parents: e338fe6
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Fri Sep 20 16:11:32 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Fri Sep 20 16:11:32 2013 -0400

----------------------------------------------------------------------
 ...yAssertionHttpServletRequestWrapperTest.java |  11 +-
 .../gateway/filter/rewrite/impl/rewrite.xml     |   8 +-
 gateway-release/home/INSTALL                    |  26 +--
 gateway-release/home/README                     |   3 +-
 gateway-release/home/deployments/sample.xml     |   6 +-
 .../home/samples/ExampleOozieWorkflow.groovy    |   2 +-
 gateway-release/home/templates/sample.conf      |   2 +-
 gateway-release/home/templates/sample.xml       |   2 +-
 gateway-release/pom.xml                         |   4 +-
 .../apache/hadoop/gateway/GatewayMessages.java  |   2 +-
 .../impl/DefaultServiceRegistryService.java     |  29 ++--
 .../org/apache/hadoop/gateway/GatewayServer.xml |   2 +-
 .../apache/hadoop/gateway/GatewayFuncTest.xml   |   4 +-
 .../apache/hadoop/gateway/TempletonDemo.java    |   2 +-
 .../topology/xml/TopologyRulesModuleTest.java   |  22 +--
 .../conf-demo/conf/gateway-default.xml          |   8 +-
 .../resources/conf-demo/conf/gateway-site.xml   |  12 +-
 .../conf-full/conf/gateway-default.xml          |   8 +-
 .../resources/conf-full/conf/gateway-site.xml   |   8 +-
 .../resources/conf-site/conf/gateway-site.xml   |   8 +-
 .../apache/hadoop/gateway/GatewayFuncTest.xml   |   6 +-
 .../xml/simple-topology-ambari-format.conf      |   2 +-
 gateway-service-hdfs/pom.xml                    |  57 -------
 .../hdfs/JobTrackerDeploymentContributor.java   |  41 -----
 .../hdfs/NameNodeDeploymentContributor.java     |  41 -----
 .../hdfs/WebHdfsDeploymentContributor.java      | 166 -------------------
 ....gateway.deploy.ServiceDeploymentContributor |  21 ---
 .../WebHdfsDeploymentContributor/rewrite.xml    |  62 -------
 gateway-service-templeton/pom.xml               |  57 -------
 .../TempletonDeploymentContributor.java         |  72 --------
 ....gateway.deploy.ServiceDeploymentContributor |  19 ---
 gateway-service-webhcat/pom.xml                 |  57 +++++++
 .../webhcat/WebHCatDeploymentContributor.java   |  71 ++++++++
 ....gateway.deploy.ServiceDeploymentContributor |  19 +++
 gateway-service-webhdfs/pom.xml                 |  57 +++++++
 .../hdfs/JobTrackerDeploymentContributor.java   |  41 +++++
 .../hdfs/NameNodeDeploymentContributor.java     |  41 +++++
 .../hdfs/WebHdfsDeploymentContributor.java      | 166 +++++++++++++++++++
 ....gateway.deploy.ServiceDeploymentContributor |  21 +++
 .../WebHdfsDeploymentContributor/rewrite.xml    |  62 +++++++
 .../apache/hadoop/gateway/shell/job/Job.java    |   2 +-
 .../hadoop/gateway/GatewayBasicFuncTest.java    |  20 +--
 .../hadoop/gateway/GatewayFuncTestDriver.java   |  18 +-
 .../WebHCatDeploymentContributorTest.java       |  45 +++++
 .../gateway/GatewayBasicFuncTest/script.pig     |   2 +-
 .../templeton-job-status.json                   |   1 -
 .../webhcat-job-status.json                     |   1 +
 hsso-release/home/INSTALL                       |  30 ++--
 hsso-release/home/README                        |   5 +-
 hsso-release/home/deployments/sample.xml        |   2 +-
 hsso-release/home/templates/topology.xml        |   2 +-
 hsso-release/pom.xml                            |   4 +-
 pom.xml                                         |   8 +-
 53 files changed, 718 insertions(+), 670 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-provider-identity-assertion-pseudo/src/test/java/org/apache/hadoop/gateway/identityasserter/filter/IdentityAssertionHttpServletRequestWrapperTest.java
----------------------------------------------------------------------
diff --git a/gateway-provider-identity-assertion-pseudo/src/test/java/org/apache/hadoop/gateway/identityasserter/filter/IdentityAssertionHttpServletRequestWrapperTest.java b/gateway-provider-identity-assertion-pseudo/src/test/java/org/apache/hadoop/gateway/identityasserter/filter/IdentityAssertionHttpServletRequestWrapperTest.java
index 9a629c0..54e7289 100644
--- a/gateway-provider-identity-assertion-pseudo/src/test/java/org/apache/hadoop/gateway/identityasserter/filter/IdentityAssertionHttpServletRequestWrapperTest.java
+++ b/gateway-provider-identity-assertion-pseudo/src/test/java/org/apache/hadoop/gateway/identityasserter/filter/IdentityAssertionHttpServletRequestWrapperTest.java
@@ -18,7 +18,6 @@
 package org.apache.hadoop.gateway.identityasserter.filter;
 
 import org.apache.commons.io.IOUtils;
-import org.apache.hadoop.gateway.identityasserter.filter.IdentityAsserterHttpServletRequestWrapper;
 import org.apache.hadoop.test.category.FastTests;
 import org.apache.hadoop.test.category.UnitTests;
 import org.apache.hadoop.test.mock.MockHttpServletRequest;
@@ -40,7 +39,7 @@ public class IdentityAssertionHttpServletRequestWrapperTest {
 
   @Test
   public void testInsertUserNameInFormParam() throws IOException {
-    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
+    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaWebHCat%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
 
     MockHttpServletRequest request = new MockHttpServletRequest();
     request.setInputStream( new MockServletInputStream( new ByteArrayInputStream( inputBody.getBytes( "UTF-8" ) ) ) );
@@ -58,7 +57,7 @@ public class IdentityAssertionHttpServletRequestWrapperTest {
 
   @Test
   public void testInsertUserNameInFormParamWithoutEncoding() throws IOException {
-    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
+    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaWebHCat%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
 
     MockHttpServletRequest request = new MockHttpServletRequest();
     request.setInputStream( new MockServletInputStream( new ByteArrayInputStream( inputBody.getBytes( "UTF-8" ) ) ) );
@@ -75,7 +74,7 @@ public class IdentityAssertionHttpServletRequestWrapperTest {
 
   @Test
   public void testInsertUserNameInFormParamWithIso88591Encoding() throws IOException {
-    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
+    String inputBody = "jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaWebHCat%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
 
     MockHttpServletRequest request = new MockHttpServletRequest();
     request.setInputStream( new MockServletInputStream( new ByteArrayInputStream( inputBody.getBytes( "UTF-8" ) ) ) );
@@ -93,7 +92,7 @@ public class IdentityAssertionHttpServletRequestWrapperTest {
 
   @Test
   public void testOverwriteUserNameInFormParam() throws IOException {
-    String inputBody = "user.name=input-user&jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
+    String inputBody = "user.name=input-user&jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaWebHCat%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
 
     MockHttpServletRequest request = new MockHttpServletRequest();
     request.setInputStream( new MockServletInputStream( new ByteArrayInputStream( inputBody.getBytes( "UTF-8" ) ) ) );
@@ -112,7 +111,7 @@ public class IdentityAssertionHttpServletRequestWrapperTest {
 
   @Test
   public void testIngoreNonFormBody() throws IOException {
-    String inputBody = "user.name=input-user&jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
+    String inputBody = "user.name=input-user&jar=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaWebHCat%2Fhadoop-examples.jar&class=org.apache.org.apache.hadoop.examples.WordCount&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Finput&arg=%2Ftmp%2FGatewayWebHdfsFuncTest%2FtestJavaMapReduceViaTempleton%2Foutput";
 
     MockHttpServletRequest request = new MockHttpServletRequest();
     request.setInputStream( new MockServletInputStream( new ByteArrayInputStream( inputBody.getBytes( "UTF-8" ) ) ) );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml
index 65ee022..7196f87 100644
--- a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml
+++ b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml
@@ -93,14 +93,14 @@
         <rewrite template="{gateway.url}/datanode/api/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
         <encode-query/>
     </rule>
-    <rule dir="IN" name="TEMPLETON/templeton/templeton/request" pattern="*://*:*/**/templeton/api/v1/{path=**}?{**}">
-        <rewrite template="http://vm:50111/templeton/v1/{path=**}?{**}"/>
+    <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/webhdfs/api/{path=**}?{**}">
+        <rewrite template="http://vm:50111/templeton/{path=**}?{**}"/>
     </rule>
     <rule dir="IN" name="OOZIE/oozie/root/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">
         <rewrite template="http://vm:11000/oozie/{**}?{**}"/>
     </rule>
-    <rule dir="IN" name="OOZIE/oozie/api/inbound" pattern="*://*:*/**/oozie/api/v1/{**}?{**}">
-        <rewrite template="http://vm:11000/oozie/v1/{**}?{**}"/>
+    <rule dir="IN" name="OOZIE/oozie/api/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">
+        <rewrite template="http://vm:11000/oozie/{**}?{**}"/>
     </rule>
 
 </rules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/INSTALL
----------------------------------------------------------------------
diff --git a/gateway-release/home/INSTALL b/gateway-release/home/INSTALL
index 95c095b..116f972 100644
--- a/gateway-release/home/INSTALL
+++ b/gateway-release/home/INSTALL
@@ -71,7 +71,7 @@ Installation and Deployment Instructions
 5. Configure the Gateway with the topology of your Hadoop cluster
    a. Edit the file {GATEWAY_HOME}/deployments/sample.xml
    b. Change the host and port in the urls of the <service> elements for
-      WEBHDFS, TEMPLETON and OOZIE services to match your Hadoop cluster
+      WEBHDFS, WEBHCAT, OOZIE, etc. services to match your Hadoop cluster
       deployment.
    c. The default configuration contains the LDAP URL for a LDAP server.  By
       default that file is configured to access the demo ApacheDS based LDAP
@@ -116,8 +116,8 @@ Installation and Deployment Instructions
    REST APIs, see the following URLs respectively:
 
    http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html
-   http://people.apache.org/~thejas/templeton_doc_v1/
-   http://oozie.apache.org/docs/3.3.1/WebServicesAPI.html
+   http://hive.apache.org/docs/hcat_r0.5.0/rest.html
+   http://oozie.apache.org/docs/4.0.0/WebServicesAPI.html
 
 ------------------------------------------------------------------------------
 Persisting the Master
@@ -205,20 +205,20 @@ Mapping Gateway URLs to Hadoop cluster URLs
 ------------------------------------------------------------------------------
 The Gateway functions much like a reverse proxy.  As such it maintains a
 mapping of URLs that are exposed externally by the Gateway to URLs that are
-provided by the Hadoop cluster.  Examples of mappings for the NameNode and
-Templeton are shown below.  These mapping are generated from the combination
+provided by the Hadoop cluster.  Examples of mappings for the WebHDFS and
+WebHCat are shown below.  These mapping are generated from the combination
 of the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml)
 and the cluster topology descriptors
 (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
   WebHDFS
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/namenode/api
-    Cluster: http://<namenode-host>:50070/webhdfs
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/webhdfs
+    Cluster: http://<webhdfs-host>:50070/webhdfs
   WebHCat (Templeton)
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api
-    Cluster: http://<templeton-host>:50111/templeton
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/webhcat
+    Cluster: http://<webhcat-host>:50111/templeton
   Oozie
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie
     Cluster: http://<templeton-host>:11000/oozie
 
 The values for <gateway-host>, <gateway-port>, <gateway-path> are provided via
@@ -227,11 +227,11 @@ the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml).
 The value for <cluster-name> is derived from the name of the cluster topology
 descriptor (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-The value for <namenode-host> and <templeton-host> is provided via the cluster
+The value for <webhdfs-host> and <webhcat-host> is provided via the cluster
 topology descriptor (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-Note: The ports 50070, 50111 and 11000 are the defaults for NameNode,
-      Templeton and Oozie respectively. Their values can also be provided via
+Note: The ports 50070, 50111 and 11000 are the defaults for WebHDFS,
+      WebHCat and Oozie respectively. Their values can also be provided via
       the cluster topology descriptor if your Hadoop cluster uses different
       ports.
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/README
----------------------------------------------------------------------
diff --git a/gateway-release/home/README b/gateway-release/home/README
index 2208d9d..fa02d17 100644
--- a/gateway-release/home/README
+++ b/gateway-release/home/README
@@ -45,7 +45,8 @@ In addition to Pseudo identity assertion Knox now provides trusted proxy user
 identity assertion for providing access to Kerberos secured Hadoop clusters.
 
 For API aggregation, the Gateway provides a central endpoint for access to
- HDFS, Templeton, Hive, HBase, Ambari and Oozie APIs for each cluster.
+WebHDFS, WebHCat/Templeton, Hive, Starbase/HBase, Ambari and Oozie APIs for
+each cluster.
 
 Future releases will extend these capabilities with additional
 authentication, identity assertion, API aggregation and eventually management

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/deployments/sample.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/deployments/sample.xml b/gateway-release/home/deployments/sample.xml
index 4474288..b7987e3 100644
--- a/gateway-release/home/deployments/sample.xml
+++ b/gateway-release/home/deployments/sample.xml
@@ -69,7 +69,7 @@
         <url>http://localhost:50070/webhdfs</url>
     </service>
     <service>
-        <role>TEMPLETON</role>
+        <role>WEBHCAT</role>
         <url>http://localhost:50111/templeton</url>
     </service>
     <service>
@@ -78,11 +78,11 @@
     </service>
     <service>
         <role>STARGATE</role>
-        <url>http://localhost:60080/</url>
+        <url>http://localhost:60080</url>
     </service>
     <service>
         <role>HIVE</role>
-        <url>http://localhost:10000/</url>
+        <url>http://localhost:10000</url>
     </service>
 
 </topology>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/samples/ExampleOozieWorkflow.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/ExampleOozieWorkflow.groovy b/gateway-release/home/samples/ExampleOozieWorkflow.groovy
index 094b2b0..543c297 100644
--- a/gateway-release/home/samples/ExampleOozieWorkflow.groovy
+++ b/gateway-release/home/samples/ExampleOozieWorkflow.groovy
@@ -83,7 +83,7 @@ configuration = """\
     </property>
     <property>
         <name>oozie.libpath</name>
-        <value>\$jobDir/lib</value>
+        <value>$jobDir/lib</value>
     </property>
     <property>
         <name>oozie.proxysubmission</name>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/templates/sample.conf
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.conf b/gateway-release/home/templates/sample.conf
index 63f707c..e9506ee 100644
--- a/gateway-release/home/templates/sample.conf
+++ b/gateway-release/home/templates/sample.conf
@@ -61,7 +61,7 @@
         <value>http://localhost:50070/webhdfs</value>
     </property>
     <property>
-        <name>topology.service.TEMPLETON..url</name>
+        <name>topology.service.WEBHCAT..url</name>
         <value>http://localhost:50111/templeton</value>
     </property>
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/home/templates/sample.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.xml b/gateway-release/home/templates/sample.xml
index 960ecdf..1203f83 100644
--- a/gateway-release/home/templates/sample.xml
+++ b/gateway-release/home/templates/sample.xml
@@ -55,7 +55,7 @@
         <url>http://localhost:50070/webhdfs</url>
     </service>
     <service>
-        <role>TEMPLETON</role>
+        <role>WEBHCAT</role>
         <url>http://localhost:50111/templeton</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-release/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-release/pom.xml b/gateway-release/pom.xml
index 0f2b601..117755d 100644
--- a/gateway-release/pom.xml
+++ b/gateway-release/pom.xml
@@ -123,7 +123,7 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-hdfs</artifactId>
+            <artifactId>gateway-service-webhdfs</artifactId>
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
@@ -131,7 +131,7 @@
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-service-templeton</artifactId>
+            <artifactId>gateway-service-webhcat</artifactId>
         </dependency>
         <dependency>
             <groupId>${gateway-group}</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
index ca468e1..6efef71 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayMessages.java
@@ -258,7 +258,7 @@ public interface GatewayMessages {
   @Message( level = MessageLevel.ERROR, text = "Failed Knox->Hadoop SPNegotiation authentication for URL: {0}" )
   void failedSPNegoAuthn(String uri);
 
-  @Message( level = MessageLevel.DEBUG, text = "Status Code Returned from Request Dispatch: {0}" )
+  @Message( level = MessageLevel.DEBUG, text = "Dispatch response status: {0}" )
   void dispatchResponseStatusCode(int statusCode);
 
   @Message( level = MessageLevel.ERROR, text = "Failed to decrypt cipher text for cluster {0}: due to inability to retrieve the password." )

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/main/java/org/apache/hadoop/gateway/services/registry/impl/DefaultServiceRegistryService.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/services/registry/impl/DefaultServiceRegistryService.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/services/registry/impl/DefaultServiceRegistryService.java
index 21b7991..662f7ba 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/services/registry/impl/DefaultServiceRegistryService.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/services/registry/impl/DefaultServiceRegistryService.java
@@ -17,12 +17,12 @@
  */
 package org.apache.hadoop.gateway.services.registry.impl;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.io.FileUtils;
 import org.apache.hadoop.gateway.GatewayMessages;
@@ -33,12 +33,11 @@ import org.apache.hadoop.gateway.services.ServiceLifecycleException;
 import org.apache.hadoop.gateway.services.registry.ServiceRegistry;
 import org.apache.hadoop.gateway.services.security.CryptoService;
 
-import com.fasterxml.jackson.core.JsonFactory;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
 
 public class DefaultServiceRegistryService implements ServiceRegistry, Service {
   private static GatewayMessages LOG = MessagesFactory.get( GatewayMessages.class );
@@ -133,12 +132,16 @@ public class DefaultServiceRegistryService implements ServiceRegistry, Service {
   }
   
   public String lookupServiceURL(String clusterName, String serviceName) {
+    String url = null;
     RegEntry entry = null;
     HashMap clusterServices = registry.get(clusterName);
     if (clusterServices != null) {
       entry = (RegEntry) clusterServices.get(serviceName);
+      if( entry != null ) {
+        url = entry.url;
+      }
     }
-    return entry.url;
+    return url;
   }
   
   private HashMap<String, HashMap<String,RegEntry>> getMapFromJsonString(String json) {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/main/resources/org/apache/hadoop/gateway/GatewayServer.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/resources/org/apache/hadoop/gateway/GatewayServer.xml b/gateway-server/src/main/resources/org/apache/hadoop/gateway/GatewayServer.xml
index b4023d8..64948af 100644
--- a/gateway-server/src/main/resources/org/apache/hadoop/gateway/GatewayServer.xml
+++ b/gateway-server/src/main/resources/org/apache/hadoop/gateway/GatewayServer.xml
@@ -52,7 +52,7 @@
     </service>
 
     <service>
-        <name>templeton</name>
+        <name>WEBHCAT</name>
         <source>/templeton/api/{path=**}?{**}</source>
         <target>http://{templeton.address}/templeton/{path=**}?{**}</target>
         <filter>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml b/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml
index 1e075ed..841c955 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml
@@ -52,8 +52,8 @@
     </service>
 
     <service>
-        <name>templeton</name>
-        <source>/templeton/api/v1/{path=**}?{**}</source>
+        <name>webhcat</name>
+        <source>/webhcat/api/v1/{path=**}?{**}</source>
         <filter>
             <name>shiro</name>
             <class>org.apache.shiro.web.servlet.ShiroFilter</class>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/java/org/apache/hadoop/gateway/TempletonDemo.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/TempletonDemo.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/TempletonDemo.java
index 28df36a..7383471 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/TempletonDemo.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/TempletonDemo.java
@@ -49,7 +49,7 @@ public class TempletonDemo {
   public void demoGateway() throws IOException {
     URL url = Loader.getResource( "log4j.properties" );
     System.out.println( url );
-    demo( "http://localhost:8888/org.apache.org.apache.hadoop.gateway/cluster/templeton/api/v1/mapreduce/jar" );
+    demo( "http://localhost:8888/gateway/cluster/webhcat/api/v1/mapreduce/jar" );
   }
 
   private void demo( String url ) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
index a5e9d32..ee9643d 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
@@ -97,17 +97,17 @@ public class TopologyRulesModuleTest {
     assertThat( topology.getServices().size(), is( 4 ) );
     assertThat( topology.getProviders().size(), is( 2 ) );
 
-    Service namenodeService = topology.getService( "WEBHDFS", null );
-    assertThat( namenodeService, notNullValue() );
-    assertThat( namenodeService.getRole(), is( "WEBHDFS" ) );
-    assertThat( namenodeService.getName(), nullValue() );
-    assertThat( namenodeService.getUrl(), is( "http://host:50070/webhdfs" ) );
-
-    Service templetonService = topology.getService( "TEMPLETON", null );
-    assertThat( templetonService, notNullValue() );
-    assertThat( templetonService.getRole(), is( "TEMPLETON" ) );
-    assertThat( templetonService.getName(), nullValue() );
-    assertThat( templetonService.getUrl(), is( "http://host:50111/templeton" ) );
+    Service webhdfsService = topology.getService( "WEBHDFS", null );
+    assertThat( webhdfsService, notNullValue() );
+    assertThat( webhdfsService.getRole(), is( "WEBHDFS" ) );
+    assertThat( webhdfsService.getName(), nullValue() );
+    assertThat( webhdfsService.getUrl(), is( "http://host:50070/webhdfs" ) );
+
+    Service webhcatService = topology.getService( "WEBHCAT", null );
+    assertThat( webhcatService, notNullValue() );
+    assertThat( webhcatService.getRole(), is( "WEBHCAT" ) );
+    assertThat( webhcatService.getName(), nullValue() );
+    assertThat( webhcatService.getUrl(), is( "http://host:50111/templeton" ) );
 
     Service oozieService = topology.getService( "OOZIE", null );
     assertThat( oozieService, notNullValue() );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml b/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
index d5477a5..944e32d 100644
--- a/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
+++ b/gateway-server/src/test/resources/conf-demo/conf/gateway-default.xml
@@ -32,15 +32,15 @@ limitations under the License.
     </property>
 
     <property>
-        <name>gateway.namenode.address</name>
+        <name>gateway.webhdfs.address</name>
         <value>localhost:50070</value>
-        <description>The default address of the NameNode.</description>
+        <description>The default address of the WebHDFS.</description>
     </property>
 
     <property>
-        <name>gateway.templeton.address</name>
+        <name>gateway.webhcat.address</name>
         <value>localhost:50111</value>
-        <description>The default address of Templeton.</description>
+        <description>The default address of WebHCat.</description>
     </property>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml b/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
index acc6005..518e737 100644
--- a/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
+++ b/gateway-server/src/test/resources/conf-demo/conf/gateway-site.xml
@@ -32,15 +32,15 @@ limitations under the License.
     </property>
 
     <property>
-        <name>gateway.namenode.address</name>
-        <value>vm.home:50070</value>
-        <description>The default address of the NameNode.</description>
+        <name>gateway.webhdfs.address</name>
+        <value>localhost:50070</value>
+        <description>The default address of WebHDFS.</description>
     </property>
 
     <property>
-        <name>gateway.templeton.address</name>
-        <value>vm.home:50111</value>
-        <description>The default address of Templeton.</description>
+        <name>gateway.webhcat.address</name>
+        <value>localhost:50111</value>
+        <description>The default address of WebHCat.</description>
     </property>
 
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/conf-full/conf/gateway-default.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-full/conf/gateway-default.xml b/gateway-server/src/test/resources/conf-full/conf/gateway-default.xml
index 1f10c6c..ab220cf 100644
--- a/gateway-server/src/test/resources/conf-full/conf/gateway-default.xml
+++ b/gateway-server/src/test/resources/conf-full/conf/gateway-default.xml
@@ -32,15 +32,15 @@ limitations under the License.
     </property>
 
     <property>
-        <name>gateway.namenode.address</name>
+        <name>gateway.webhdfs.address</name>
         <value>localhost:50070</value>
-        <description>The default address of the NameNode.</description>
+        <description>The default address of WebHDFS.</description>
     </property>
 
     <property>
-        <name>gateway.templeton.address</name>
+        <name>gateway.webhcat.address</name>
         <value>localhost:50111</value>
-        <description>The default address of Templeton.</description>
+        <description>The default address of WebHCat.</description>
     </property>
 
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/conf-full/conf/gateway-site.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-full/conf/gateway-site.xml b/gateway-server/src/test/resources/conf-full/conf/gateway-site.xml
index 8afeae4..8ba5278 100644
--- a/gateway-server/src/test/resources/conf-full/conf/gateway-site.xml
+++ b/gateway-server/src/test/resources/conf-full/conf/gateway-site.xml
@@ -32,15 +32,15 @@ limitations under the License.
     </property>
 
     <property>
-        <name>gateway.namenode.address</name>
+        <name>gateway.webhdfs.address</name>
         <value>localhost:50070</value>
-        <description>The default address of the NameNode.</description>
+        <description>The default address of WebHDFS.</description>
     </property>
 
     <property>
-        <name>gateway.templeton.address</name>
+        <name>gateway.webhcat.address</name>
         <value>localhost:50111</value>
-        <description>The default address of Templeton.</description>
+        <description>The default address of WebHCat.</description>
     </property>
 
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/conf-site/conf/gateway-site.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/conf-site/conf/gateway-site.xml b/gateway-server/src/test/resources/conf-site/conf/gateway-site.xml
index edb3332..ec7b42c 100644
--- a/gateway-server/src/test/resources/conf-site/conf/gateway-site.xml
+++ b/gateway-server/src/test/resources/conf-site/conf/gateway-site.xml
@@ -32,15 +32,15 @@ limitations under the License.
     </property>
 
     <property>
-        <name>gateway.namenode.address</name>
+        <name>gateway.webhdfs.address</name>
         <value>localhost:50070</value>
-        <description>The default address of the NameNode.</description>
+        <description>The default address of WebHDFS.</description>
     </property>
 
     <property>
-        <name>gateway.templeton.address</name>
+        <name>gateway.webhcat.address</name>
         <value>localhost:50111</value>
-        <description>The default address of Templeton.</description>
+        <description>The default address of WebHCat.</description>
     </property>
 
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml b/gateway-server/src/test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml
index 56785e9..8db66bc 100644
--- a/gateway-server/src/test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml
+++ b/gateway-server/src/test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml
@@ -53,9 +53,9 @@
     </resource>
 
     <resource>
-        <!--<name>templeton</name>-->
-        <source>/templeton/api/v1/{path=**}?{**}</source>
-        <target>http://{templeton.address}/templeton/{path=**}?{**}</target>
+        <!--<name>webhdfs</name>-->
+        <source>/webhcat/api/v1/{path=**}?{**}</source>
+        <target>http://{webhcat.address}/templeton/{path=**}?{**}</target>
         <filter>
             <role>authentication</role>
             <class>org.apache.shiro.web.servlet.ShiroFilter</class>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf b/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
index 8197013..fd105f2 100644
--- a/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
+++ b/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
@@ -61,7 +61,7 @@
         <value>http://host:50070/webhdfs</value>
     </property>
     <property>
-        <name>topology.service.TEMPLETON..url</name>
+        <name>topology.service.WEBHCAT..url</name>
         <value>http://host:50111/templeton</value>
     </property>
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/pom.xml b/gateway-service-hdfs/pom.xml
deleted file mode 100644
index a273a34..0000000
--- a/gateway-service-hdfs/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.hadoop</groupId>
-        <artifactId>gateway</artifactId>
-        <version>0.3.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>gateway-service-hdfs</artifactId>
-
-    <name>gateway-service-hdfs</name>
-    <description>The extension to the gateway for supporting WebHDFS.</description>
-
-    <licenses>
-        <license>
-            <name>The Apache Software License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <dependencies>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-spi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-provider-rewrite</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java b/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
deleted file mode 100644
index d982592..0000000
--- a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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.hadoop.gateway.hdfs;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.topology.Service;
-
-public class JobTrackerDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  @Override
-  public String getRole() {
-    return "JOBTRACKER";
-  }
-
-  @Override
-  public String getName() {
-    return "jobtracker";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    // NoOp
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java b/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
deleted file mode 100644
index 6203bb0..0000000
--- a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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.hadoop.gateway.hdfs;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.topology.Service;
-
-public class NameNodeDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  @Override
-  public String getRole() {
-    return "NAMENODE";
-  }
-
-  @Override
-  public String getName() {
-    return "namenode";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    // NoOp
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java b/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
deleted file mode 100644
index f39912d..0000000
--- a/gateway-service-hdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/**
- * 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.hadoop.gateway.hdfs;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptorFactory;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  private static final String RULES_RESOURCE = WebHdfsDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
-  private static final String WEBHDFS_EXTERNAL_PATH = "/namenode/api/v1";
-  private static final String DATANODE_EXTERNAL_PATH = "/datanode/api/v1";
-//  private static final String WEBHDFS_INTERNAL_PATH = "/webhdfs";
-//  private static final String CLUSTER_URL_FUNCTION = "{gateway.url}";
-
-  @Override
-  public String getRole() {
-    return "WEBHDFS";
-  }
-
-  @Override
-  public String getName() {
-    return "webhdfs";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws Exception {
-    contributeRewriteRules( context, service );
-    contributeNameNodeResource( context, service );
-    contributeDataNodeResource( context, service );
-  }
-
-  private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException, IOException {
-    UrlRewriteRulesDescriptor serviceRules = loadRulesFromClassPath();
-    UrlRewriteRulesDescriptor clusterRules = context.getDescriptor( "rewrite" );
-    clusterRules.addRules( serviceRules );
-
-//    UrlRewriteRulesDescriptor rules = context.getDescriptor( "rewrite" );
-//    UrlRewriteRuleDescriptor rule;
-//    UrlRewriteActionRewriteDescriptorExt rewrite;
-//    UrlRewriteMatchDescriptor match;
-//
-//    rule = rules.addRule( getQualifiedName() + "/namenode/root/inbound" )
-//        .directions( "inbound" )
-//        .pattern( "*://*:*/**" + WEBHDFS_EXTERNAL_PATH + "/?{**}" );
-//    rewrite = rule.addStep( "rewrite" );
-//    //rewrite.template( service.getUrl().toExternalForm() + "/?user.name={$username}&{**}" );
-//    rewrite.template( service.getUrl() + "/?{**}" );
-//
-//    rule = rules.addRule( getQualifiedName() + "/namenode/file/inbound" )
-//        .directions( "inbound" )
-//        .pattern( "*://*:*/**" + WEBHDFS_EXTERNAL_PATH + "/{path=**}?{**}" );
-//    rewrite = rule.addStep( "rewrite" );
-//    //rewrite.template( service.getUrl().toExternalForm() + "/{path=**}?user.name={$username}&{**}" );
-//    rewrite.template( service.getUrl() + "/{path=**}?{**}" );
-//
-//    rule = rules.addRule( getQualifiedName() + "/datanode/inbound" )
-//        .directions( "inbound" )
-//        .pattern( "*://*:*/**" + DATANODE_EXTERNAL_PATH + "/{path=**}?**" );
-//    //TODO: If the input type is wrong it throws a NPE.
-//    rule.addStep( "decode-query" );
-//    match = rule.addStep( "match" );
-//    match.pattern( "*://*:*/**" + DATANODE_EXTERNAL_PATH + "/{path=**}?{host}&{port}&{**}" );
-//    rewrite = rule.addStep( "rewrite" );
-//    rewrite.template( "http://{host}:{port}/{path=**}?{**}" );
-//
-//    rule = rules.addRule( getQualifiedName() + "/datanode/outbound" )
-//        .directions( "outbound" );
-//    match = rule.addStep( "match" );
-//    match.pattern( "*://{host}:{port}/{path=**}?{**}" );
-//    rewrite = rule.addStep( "rewrite" );
-//    rewrite.template( CLUSTER_URL_FUNCTION + DATANODE_EXTERNAL_PATH + "/{path=**}?host={$hostmap(host)}&{port}&{**}" );
-//    rule.addStep( "encode-query" );
-//
-//    UrlRewriteFilterDescriptor filter = rules.addFilter( getQualifiedName() + "/outbound" );
-//    UrlRewriteFilterContentDescriptor content = filter.addContent( "application/x-http-headers" );
-//    content.addApply( "Location", getQualifiedName() + "/datanode/outbound" );
-  }
-
-  public void contributeNameNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
-    List<FilterParamDescriptor> params;
-    ResourceDescriptor rootResource = context.getGatewayDescriptor().addResource();
-    rootResource.role( service.getRole() );
-    rootResource.pattern( WEBHDFS_EXTERNAL_PATH + "/?**" );
-    addAuthenticationFilter( context, service, rootResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( rootResource.createFilterParam().
-        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/root" ) );
-    addRewriteFilter( context, service, rootResource, params );
-    addIdentityAssertionFilter( context, service, rootResource );
-    addAuthorizationFilter( context, service, rootResource );
-    addDispatchFilter( context, service, rootResource, "dispatch", null );
-
-    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
-    fileResource.role( service.getRole() );
-    fileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/**?**" );
-    addAuthenticationFilter( context, service, fileResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( fileResource.createFilterParam().
-        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/namenode/file" ) );
-    params.add( fileResource.createFilterParam().
-        name( UrlRewriteServletFilter.RESPONSE_HEADERS_FILTER_PARAM ).value( getQualifiedName() + "/outbound/namenode/headers" ) );
-    addRewriteFilter( context, service, fileResource, params );
-    addIdentityAssertionFilter( context, service, fileResource );
-    addAuthorizationFilter( context, service, fileResource );
-    addDispatchFilter( context, service, fileResource, "dispatch", null );
-  }
-
-  public void contributeDataNodeResource( DeploymentContext context, Service service ) throws URISyntaxException {
-    List<FilterParamDescriptor> params;
-    ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
-    fileResource.role( service.getRole() );
-    fileResource.pattern( DATANODE_EXTERNAL_PATH + "/**?**" );
-    addAuthenticationFilter( context, service, fileResource );
-    addIdentityAssertionFilter( context, service, fileResource );
-    addAuthorizationFilter( context, service, fileResource );
-    params = new ArrayList<FilterParamDescriptor>();
-    params.add( fileResource.createFilterParam().
-        name( UrlRewriteServletFilter.REQUEST_URL_RULE_PARAM ).value( getQualifiedName() + "/inbound/datanode" ) );
-    addRewriteFilter( context, service, fileResource, params );
-    addDispatchFilter( context, service, fileResource, "dispatch", null );
-  }
-
-  String getQualifiedName() {
-    return getRole() + "/" + getName();
-  }
-
-  UrlRewriteRulesDescriptor loadRulesFromClassPath() throws IOException {
-    InputStream stream = this.getClass().getClassLoader().getResourceAsStream( RULES_RESOURCE );
-    Reader reader = new InputStreamReader( stream );
-    UrlRewriteRulesDescriptor rules = UrlRewriteRulesDescriptorFactory.load( "xml", reader );
-    reader.close();
-    stream.close();
-    return rules;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-hdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
deleted file mode 100644
index 0a3d6ee..0000000
--- a/gateway-service-hdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
+++ /dev/null
@@ -1,21 +0,0 @@
-##########################################################################
-# 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.
-##########################################################################
-
-org.apache.hadoop.gateway.hdfs.WebHdfsDeploymentContributor
-org.apache.hadoop.gateway.hdfs.NameNodeDeploymentContributor
-org.apache.hadoop.gateway.hdfs.JobTrackerDeploymentContributor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-hdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-hdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml b/gateway-service-hdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
deleted file mode 100644
index d0bd2e2..0000000
--- a/gateway-service-hdfs/src/main/resources/org/apache/hadoop/gateway/hdfs/WebHdfsDeploymentContributor/rewrite.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-<?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="OUT" name="WEBHDFS/webhdfs/outbound" pattern="hdfs://*:*/{path=**}?{**}">
-        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
-    </rule>
-
-    <rule dir="OUT" name="WEBHDFS/webhdfs/outbound" pattern="webhdfs://*:*/{path=**}?{**}">
-        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
-    </rule>
-
-    <rule dir="OUT" name="WEBHDFS/webhdfs/outbound/namenode/headers/location">
-        <match pattern="{scheme}://{host}:{port}/{path=**}?{**}"/>
-        <rewrite template="{gateway.url}/datanode/api/v1/{path=**}?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
-        <encrypt-query/>
-    </rule>
-
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/hdfs" pattern="hdfs:/{path=**}?{**}">
-        <rewrite template="{$serviceMappedUrl[NAMENODE]}/{path=**}?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/webhdfs" pattern="webhdfs:/{path=**}?{**}">
-        <rewrite template="{$serviceUrl[WEBHDFS]}/{path=**}?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/**/namenode/api/{version}/?{**}">
-        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/file" pattern="*://*:*/**/namenode/api/{version}/{path=**}?{**}">
-        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/{path=**}?{**}"/>
-    </rule>
-
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/datanode">
-        <decrypt-query/>
-        <match pattern="*://*:*/**/datanode/api/*/{path=**}?{scheme}?{host}?{port}?{**}"/>
-        <rewrite template="{scheme}://{host}:{port}/{path=**}?{**}"/>
-    </rule>
-
-    <filter name="WEBHDFS/webhdfs/outbound/namenode/headers">
-        <content type="application/x-http-headers">
-            <apply path="Location" rule="WEBHDFS/webhdfs/outbound/namenode/headers/location"/>
-        </content>
-    </filter>
-
-</rules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-templeton/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-templeton/pom.xml b/gateway-service-templeton/pom.xml
deleted file mode 100644
index 7ef4953..0000000
--- a/gateway-service-templeton/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.hadoop</groupId>
-        <artifactId>gateway</artifactId>
-        <version>0.3.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>gateway-service-templeton</artifactId>
-
-    <name>gateway-service-templeton</name>
-    <description>The extension to the gateway for supporting Templeton.</description>
-
-    <licenses>
-        <license>
-            <name>The Apache Software License, Version 2.0</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-            <distribution>repo</distribution>
-        </license>
-    </licenses>
-
-    <dependencies>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-spi</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>${gateway-group}</groupId>
-            <artifactId>gateway-provider-rewrite</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java b/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
deleted file mode 100644
index d0f97c1..0000000
--- a/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * 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.hadoop.gateway.templeton;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRuleDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
-import org.apache.hadoop.gateway.filter.rewrite.ext.UrlRewriteActionRewriteDescriptorExt;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.net.URISyntaxException;
-
-public class
-    TempletonDeploymentContributor extends ServiceDeploymentContributorBase {
-
-  private static final String TEMPLETON_EXTERNAL_PATH = "/templeton/api/v1";
-
-  @Override
-  public String getRole() {
-    return "TEMPLETON";
-  }
-
-  @Override
-  public String getName() {
-    return "templeton";
-  }
-
-  @Override
-  public void contributeService( DeploymentContext context, Service service ) throws URISyntaxException {
-    UrlRewriteRulesDescriptor rules = context.getDescriptor( "rewrite" );
-    UrlRewriteRuleDescriptor rule;
-    UrlRewriteActionRewriteDescriptorExt rewrite;
-
-    rule = rules.addRule( getRole() + "/" + getName() + "/templeton/request" )
-        .directions( "request" )
-        .pattern( "*://*:*/**" + TEMPLETON_EXTERNAL_PATH + "/{path=**}?{**}" );
-    rewrite = rule.addStep( "rewrite" );
-    rewrite.template( service.getUrl() + "/v1/{path=**}?{**}" );
-
-    ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
-    resource.role( service.getRole() );
-    resource.pattern( TEMPLETON_EXTERNAL_PATH + "/**?**" );
-    if (topologyContainsProviderType(context, "authentication")) {
-      context.contributeFilter( service, resource, "authentication", null, null );
-    }
-    if (topologyContainsProviderType(context, "federation")) {
-      context.contributeFilter( service, resource, "federation", null, null );
-    }
-    context.contributeFilter( service, resource, "rewrite", null, null );
-    context.contributeFilter( service, resource, "identity-assertion", null, null );
-    addAuthorizationFilter(context, service, resource);
-    context.contributeFilter( service, resource, "dispatch", null, null );
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-templeton/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-templeton/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-templeton/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
deleted file mode 100644
index 020412f..0000000
--- a/gateway-service-templeton/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
+++ /dev/null
@@ -1,19 +0,0 @@
-##########################################################################
-# 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.
-##########################################################################
-
-org.apache.hadoop.gateway.templeton.TempletonDeploymentContributor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhcat/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-webhcat/pom.xml b/gateway-service-webhcat/pom.xml
new file mode 100644
index 0000000..a013f5c
--- /dev/null
+++ b/gateway-service-webhcat/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.hadoop</groupId>
+        <artifactId>gateway</artifactId>
+        <version>0.3.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>gateway-service-webhcat</artifactId>
+
+    <name>gateway-service-webhcat</name>
+    <description>The extension to the gateway for supporting WebHCat.</description>
+
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <dependencies>
+        <dependency>
+            <groupId>${gateway-group}</groupId>
+            <artifactId>gateway-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${gateway-group}</groupId>
+            <artifactId>gateway-provider-rewrite</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhcat/src/main/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhcat/src/main/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributor.java b/gateway-service-webhcat/src/main/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributor.java
new file mode 100644
index 0000000..5fa8628
--- /dev/null
+++ b/gateway-service-webhcat/src/main/java/org/apache/hadoop/gateway/webhcat/WebHCatDeploymentContributor.java
@@ -0,0 +1,71 @@
+/**
+ * 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.hadoop.gateway.webhcat;
+
+import org.apache.hadoop.gateway.deploy.DeploymentContext;
+import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
+import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
+import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRuleDescriptor;
+import org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteRulesDescriptor;
+import org.apache.hadoop.gateway.filter.rewrite.ext.UrlRewriteActionRewriteDescriptorExt;
+import org.apache.hadoop.gateway.topology.Service;
+
+import java.net.URISyntaxException;
+
+public class WebHCatDeploymentContributor extends ServiceDeploymentContributorBase {
+
+  private static final String WEBHCAT_EXTERNAL_PATH = "/webhcat/api/v1";
+
+  @Override
+  public String getRole() {
+    return "WEBHCAT";
+  }
+
+  @Override
+  public String getName() {
+    return "webhcat";
+  }
+
+  @Override
+  public void contributeService( DeploymentContext context, Service service ) throws URISyntaxException {
+    UrlRewriteRulesDescriptor rules = context.getDescriptor( "rewrite" );
+    UrlRewriteRuleDescriptor rule;
+    UrlRewriteActionRewriteDescriptorExt rewrite;
+
+    rule = rules.addRule( getRole() + "/" + getName() + "/request" )
+        .directions( "request" )
+        .pattern( "*://*:*/**" + WEBHCAT_EXTERNAL_PATH + "/{path=**}?{**}" );
+    rewrite = rule.addStep( "rewrite" );
+    rewrite.template( service.getUrl() + "/v1/{path=**}?{**}" );
+
+    ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
+    resource.role( service.getRole() );
+    resource.pattern( WEBHCAT_EXTERNAL_PATH + "/**?**" );
+    if (topologyContainsProviderType(context, "authentication")) {
+      context.contributeFilter( service, resource, "authentication", null, null );
+    }
+    if (topologyContainsProviderType(context, "federation")) {
+      context.contributeFilter( service, resource, "federation", null, null );
+    }
+    context.contributeFilter( service, resource, "rewrite", null, null );
+    context.contributeFilter( service, resource, "identity-assertion", null, null );
+    addAuthorizationFilter(context, service, resource);
+    context.contributeFilter( service, resource, "dispatch", null, null );
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhcat/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-webhcat/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor b/gateway-service-webhcat/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
new file mode 100644
index 0000000..1b74d89
--- /dev/null
+++ b/gateway-service-webhcat/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ServiceDeploymentContributor
@@ -0,0 +1,19 @@
+##########################################################################
+# 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.
+##########################################################################
+
+org.apache.hadoop.gateway.webhcat.WebHCatDeploymentContributor
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/pom.xml
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/pom.xml b/gateway-service-webhdfs/pom.xml
new file mode 100644
index 0000000..5f52ca4
--- /dev/null
+++ b/gateway-service-webhdfs/pom.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.hadoop</groupId>
+        <artifactId>gateway</artifactId>
+        <version>0.3.0-SNAPSHOT</version>
+    </parent>
+    <artifactId>gateway-service-webhdfs</artifactId>
+
+    <name>gateway-service-webhdfs</name>
+    <description>The extension to the gateway for supporting WebHDFS.</description>
+
+    <licenses>
+        <license>
+            <name>The Apache Software License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <dependencies>
+        <dependency>
+            <groupId>${gateway-group}</groupId>
+            <artifactId>gateway-spi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>${gateway-group}</groupId>
+            <artifactId>gateway-provider-rewrite</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
new file mode 100644
index 0000000..d982592
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/JobTrackerDeploymentContributor.java
@@ -0,0 +1,41 @@
+/**
+ * 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.hadoop.gateway.hdfs;
+
+import org.apache.hadoop.gateway.deploy.DeploymentContext;
+import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
+import org.apache.hadoop.gateway.topology.Service;
+
+public class JobTrackerDeploymentContributor extends ServiceDeploymentContributorBase {
+
+  @Override
+  public String getRole() {
+    return "JOBTRACKER";
+  }
+
+  @Override
+  public String getName() {
+    return "jobtracker";
+  }
+
+  @Override
+  public void contributeService( DeploymentContext context, Service service ) throws Exception {
+    // NoOp
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/9567e7c0/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
new file mode 100644
index 0000000..6203bb0
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeDeploymentContributor.java
@@ -0,0 +1,41 @@
+/**
+ * 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.hadoop.gateway.hdfs;
+
+import org.apache.hadoop.gateway.deploy.DeploymentContext;
+import org.apache.hadoop.gateway.deploy.ServiceDeploymentContributorBase;
+import org.apache.hadoop.gateway.topology.Service;
+
+public class NameNodeDeploymentContributor extends ServiceDeploymentContributorBase {
+
+  @Override
+  public String getRole() {
+    return "NAMENODE";
+  }
+
+  @Override
+  public String getName() {
+    return "namenode";
+  }
+
+  @Override
+  public void contributeService( DeploymentContext context, Service service ) throws Exception {
+    // NoOp
+  }
+
+}