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/24 17:44:21 UTC

[1/8] git commit: KNOX-42: Changed webhcat URLs.

Updated Branches:
  refs/heads/master c44e01027 -> 209d23bcd


KNOX-42: Changed webhcat URLs.


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

Branch: refs/heads/master
Commit: e5484ea111ef177cc7cbeb3ca7cf91a8eb9d9ad4
Parents: a6fdb19
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Mon Sep 23 21:55:38 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:15 2013 -0400

----------------------------------------------------------------------
 .../org/apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml    | 4 ++--
 .../src/test/java/org/apache/hadoop/gateway/GatewayFuncTest.xml  | 2 +-
 .../src/test/java/org/apache/hadoop/gateway/TempletonDemo.java   | 2 +-
 .../test/resources/org/apache/hadoop/gateway/GatewayFuncTest.xml | 4 ++--
 .../hadoop/gateway/webhcat/WebHCatDeploymentContributor.java     | 2 +-
 .../src/main/java/org/apache/hadoop/gateway/shell/job/Job.java   | 2 +-
 .../java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java     | 4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e5484ea1/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 1278ffa..a61820f 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,8 +93,8 @@
         <rewrite template="{gateway.url}/webhdfs/data/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
         <encode-query/>
     </rule>
-    <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/webhcat/api/{path=**}?{**}">
-        <rewrite template="http://vm:50111/templeton/{path=**}?{**}"/>
+    <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/templeton/{version}/{path=**}?{**}">
+        <rewrite template="http://vm:50111/templeton/{version}/{path=**}?{**}"/>
     </rule>
     <rule dir="IN" name="OOZIE/oozie/root/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">
         <rewrite template="http://vm:11000/oozie/{**}?{**}"/>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e5484ea1/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 8dfc59d..5a4ea59 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
@@ -53,7 +53,7 @@
 
     <service>
         <name>webhcat</name>
-        <source>/webhcat/api/v1/{path=**}?{**}</source>
+        <source>/templeton/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/e5484ea1/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 7383471..e262761 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/gateway/cluster/webhcat/api/v1/mapreduce/jar" );
+    demo( "http://localhost:8888/gateway/cluster/templeton/v1/mapreduce/jar" );
   }
 
   private void demo( String url ) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e5484ea1/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 abcf963..2ae450b 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
@@ -54,8 +54,8 @@
 
     <resource>
         <!--<name>webhdfs</name>-->
-        <source>/webhcat/api/v1/{path=**}?{**}</source>
-        <target>http://{webhcat.address}/templeton/{path=**}?{**}</target>
+        <source>/templeton/v1/{path=**}?{**}</source>
+        <target>http://{webhcat.address}/templeton/v1/{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/e5484ea1/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
index 5fa8628..d464920 100644
--- 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
@@ -29,7 +29,7 @@ import java.net.URISyntaxException;
 
 public class WebHCatDeploymentContributor extends ServiceDeploymentContributorBase {
 
-  private static final String WEBHCAT_EXTERNAL_PATH = "/webhcat/api/v1";
+  private static final String WEBHCAT_EXTERNAL_PATH = "/templeton/v1";
 
   @Override
   public String getRole() {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e5484ea1/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 5dca126..f374244 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 = "/webhcat/api/v1";
+  static String SERVICE_PATH = "/templeton/v1";
 
   public static Java.Request submitJava( Hadoop session ) {
     return new Java.Request( session );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e5484ea1/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 272d514..77f70e2 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
@@ -119,7 +119,7 @@ public class GatewayBasicFuncTest {
     driver.setupLdap( findFreePort() );
     driver.setupService( "WEBHDFS", "http://" + TEST_HOST + ":50070/webhdfs", "/cluster/webhdfs", USE_MOCK_SERVICES );
     driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/webhdfs/data", USE_MOCK_SERVICES );
-    driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/webhcat", "/cluster/webhcat/api", USE_MOCK_SERVICES );
+    driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton", 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 + ":60080", "/cluster/hbase/api/v1", USE_MOCK_SERVICES );
@@ -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/webhcat/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/templeton/v1/mapreduce/jar'
     {"id":"job_201210301335_0059"}
     */
     String job = driver.submitJava(


[2/8] git commit: KNOX-42: Changed namenode URLs.

Posted by km...@apache.org.
KNOX-42: Changed namenode URLs.


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

Branch: refs/heads/master
Commit: a6fdb19fd17877539cb96f26d2f999b894c3629b
Parents: 8701269
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Mon Sep 23 17:12:06 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:15 2013 -0400

----------------------------------------------------------------------
 .../hadoop/gateway/filter/rewrite/impl/gateway.xml  |  2 +-
 .../hadoop/gateway/filter/rewrite/impl/rewrite.xml  |  4 ++--
 gateway-release/home/samples/SampleService.groovy   |  2 +-
 .../org/apache/hadoop/gateway/GatewayServer.xml     |  6 +++---
 .../org/apache/hadoop/gateway/GatewayFuncTest.xml   |  6 +++---
 .../org/apache/hadoop/gateway/GatewayFuncTest.xml   |  6 +++---
 .../gateway/hdfs/WebHdfsDeploymentContributor.java  |  2 +-
 .../hdfs/WebHdfsDeploymentContributor/rewrite.xml   |  8 ++++----
 .../org/apache/hadoop/gateway/shell/hdfs/Hdfs.java  |  2 +-
 .../apache/hadoop/gateway/GatewayBasicFuncTest.java | 14 +++++++-------
 .../gateway/deploy/DeploymentFactoryFuncTest.java   |  6 ++----
 .../gateway/util/urltemplate/MatcherTest.java       | 16 ++++++++--------
 .../hadoop/gateway/util/urltemplate/ParserTest.java |  2 +-
 .../gateway/util/urltemplate/RewriterTest.java      | 14 +++++++-------
 14 files changed, 44 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/gateway.xml
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/gateway.xml b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/gateway.xml
index 0ed824c..cf0a491 100644
--- a/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/gateway.xml
+++ b/gateway-provider-rewrite/src/test/java/org/apache/hadoop/gateway/filter/rewrite/impl/gateway.xml
@@ -18,7 +18,7 @@
 <gateway>
     <resource>
         <role>WEBHDFS</role>
-        <pattern>/namenode/api/v1/?**</pattern>
+        <pattern>/webhdfs/v1/?**</pattern>
         ...
         <filter>
             <role>rewrite</role>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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 b10fe0a..1278ffa 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
@@ -77,10 +77,10 @@
     ContentPathParser
     -->
 
-    <rule dir="IN" name="WEBHDFS/webhdfs/namenode/root/inbound" pattern="*://*:*/**/namenode/api/{version}/?{**}">
+    <rule dir="IN" name="WEBHDFS/webhdfs/namenode/root/inbound" pattern="*://*:*/**/webhdfs/{version}/?{**}">
         <rewrite template="http://vm:50070/webhdfs/{version}/?{**}"/>
     </rule>
-    <rule dir="IN" name="WEBHDFS/webhdfs/namenode/file/inbound" pattern="*://*:*/**/namenode/api/{version}/{path=**}?{**}">
+    <rule dir="IN" name="WEBHDFS/webhdfs/namenode/file/inbound" pattern="*://*:*/**/webhdfs/{version}/{path=**}?{**}">
         <rewrite template="http://vm:50070/webhdfs/{version}/{path=**}?{**}"/>
     </rule>
     <rule dir="IN" name="WEBHDFS/webhdfs/datanode/inbound" pattern="*://*:*/**/webhdfs/data/{version}/{path=**}?**">

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-release/home/samples/SampleService.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/SampleService.groovy b/gateway-release/home/samples/SampleService.groovy
index e8c5bdf..3b1345c 100644
--- a/gateway-release/home/samples/SampleService.groovy
+++ b/gateway-release/home/samples/SampleService.groovy
@@ -19,7 +19,7 @@ import org.apache.hadoop.gateway.shell.Hadoop
 
 class SampleService {
 
-  static String PATH = "/namenode/api/v1"
+  static String PATH = "/webhdfs/v1"
 
   static SampleSimpleCommand simple( Hadoop hadoop ) {
     return new SampleSimpleCommand( hadoop )

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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 64948af..0075a04 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
@@ -19,7 +19,7 @@
 
     <service>
         <name>namenode-root</name>
-        <source>/namenode/api/v1?{**}</source>
+        <source>/webhdfs/v1?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/?{**}</target>
         <filter>
             <name>shiro</name>
@@ -33,7 +33,7 @@
 
     <service>
         <name>namenode-children</name>
-        <source>/namenode/api/v1/{path=**}?{**}</source>
+        <source>/webhdfs/v1/{path=**}?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/{path=**}?{**}</target>
         <filter>
             <name>shiro</name>
@@ -43,7 +43,7 @@
             <name>rewrite</name>
             <class>org.apache.org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter</class>
             <rewrite>webhdfs://*:*/{path=**}
-                http://{gateway.address}/gateway/gateway/namenode/api/v1/{path=**}</rewrite>
+                http://{gateway.address}/webhdfs/v1/{path=**}</rewrite>
         </filter>
         <filter>
             <name>dispatch</name>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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 841c955..8dfc59d 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
@@ -19,7 +19,7 @@
 
     <service>
         <name>namenode-root</name>
-        <source>/namenode/api/v1?{**}</source>
+        <source>/webhdfs/v1?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/?{**}</target>
         <filter>
             <name>shiro</name>
@@ -33,7 +33,7 @@
 
     <service>
         <name>namenode-children</name>
-        <source>/namenode/api/v1/{path=**}?{**}</source>
+        <source>/webhdfs/v1/{path=**}?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/{path=**}?{**}</target>
         <filter>
             <name>shiro</name>
@@ -43,7 +43,7 @@
             <name>rewrite</name>
             <class>org.apache.org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter</class>
             <rewrite>webhdfs://*:*/{path=**}
-                http://{org.apache.org.apache.hadoop.gateway.address}/org.apache.hadoopache.hadoop.gateway/gateway/namenode/api/v1/{path=**}</rewrite>
+                http://{org.apache.org.apache.hadoop.gateway.address}/org.apache.hadoopache.hadoop.gateway/gateway/webhdfs/v1/{path=**}</rewrite>
         </filter>
         <filter>
             <name>dispatch</name>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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 8db66bc..abcf963 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
@@ -18,7 +18,7 @@
 
     <resource>
         <!--<name>namenode-root</name>-->
-        <source>/namenode/api/v1?{**}</source>
+        <source>/webhdfs/v1?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/?{**}</target>
         <filter>
             <role>authentication</role>
@@ -32,7 +32,7 @@
 
     <resource>
         <!--<name>namenode-children</name>-->
-        <source>/namenode/api/v1/{path=**}?{**}</source>
+        <source>/webhdfs/v1/{path=**}?{**}</source>
         <target>http://{namenode.address}/webhdfs/v1/{path=**}?{**}</target>
         <filter>
             <role>authentication</role>
@@ -43,7 +43,7 @@
             <class>org.apache.hadoop.gateway.filter.rewrite.api.UrlRewriteServletFilter</class>
             <param>
                 <name>rewrite</name>
-                <value>webhdfs://*:*/{path=**} {gateway.url}/namenode/api/v1/{path=**}</value>
+                <value>webhdfs://*:*/{path=**} {gateway.url}/webhdfs/v1/{path=**}</value>
             </param>
         </filter>
         <filter>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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
index b7f0ec5..eff7f47 100644
--- 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
@@ -37,7 +37,7 @@ 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 WEBHDFS_EXTERNAL_PATH = "/webhdfs/v1";
   private static final String DATANODE_EXTERNAL_PATH = "/webhdfs/data/v1";
 //  private static final String WEBHDFS_INTERNAL_PATH = "/webhdfs";
 //  private static final String CLUSTER_URL_FUNCTION = "{gateway.url}";

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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
index 0c746b6..66081ee 100644
--- 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
@@ -18,11 +18,11 @@
 <rules>
 
     <rule dir="OUT" name="WEBHDFS/webhdfs/outbound" pattern="hdfs://*:*/{path=**}?{**}">
-        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
+        <rewrite template="{gateway.url}/webhdfs/v1/{path=**}?{**}"/>
     </rule>
 
     <rule dir="OUT" name="WEBHDFS/webhdfs/outbound" pattern="webhdfs://*:*/{path=**}?{**}">
-        <rewrite template="{gateway.url}/namenode/api/v1/{path=**}?{**}"/>
+        <rewrite template="{gateway.url}/webhdfs/v1/{path=**}?{**}"/>
     </rule>
 
     <rule dir="OUT" name="WEBHDFS/webhdfs/outbound/namenode/headers/location">
@@ -39,11 +39,11 @@
         <rewrite template="{$serviceUrl[WEBHDFS]}/{path=**}?{**}"/>
     </rule>
 
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/**/namenode/api/{version}/?{**}">
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/**/webhdfs/{version}/?{**}">
         <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/?{**}"/>
     </rule>
 
-    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/file" pattern="*://*:*/**/namenode/api/{version}/{path=**}?{**}">
+    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/file" pattern="*://*:*/**/webhdfs/{version}/{path=**}?{**}">
         <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/{path=**}?{**}"/>
     </rule>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hdfs/Hdfs.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hdfs/Hdfs.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hdfs/Hdfs.java
index f1c84c9..b5b8bf3 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hdfs/Hdfs.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hdfs/Hdfs.java
@@ -21,7 +21,7 @@ import org.apache.hadoop.gateway.shell.Hadoop;
 
 public class Hdfs {
 
-  static String SERVICE_PATH = "/namenode/api/v1";
+  static String SERVICE_PATH = "/webhdfs/v1";
 
   public static Ls.Request ls( Hadoop session ) {
     return new Ls.Request( session );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/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 b03b6cb..272d514 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
@@ -117,7 +117,7 @@ public class GatewayBasicFuncTest {
     config.setGatewayPath( "gateway" );
     driver.setResourceBase( GatewayBasicFuncTest.class );
     driver.setupLdap( findFreePort() );
-    driver.setupService( "WEBHDFS", "http://" + TEST_HOST + ":50070/webhdfs", "/cluster/namenode/api", USE_MOCK_SERVICES );
+    driver.setupService( "WEBHDFS", "http://" + TEST_HOST + ":50070/webhdfs", "/cluster/webhdfs", USE_MOCK_SERVICES );
     driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/webhdfs/data", 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 );
@@ -673,17 +673,17 @@ public class GatewayBasicFuncTest {
     driver.deleteFile( user, pass, root, "true", HttpStatus.SC_OK );
 
     /* Put the mapreduce code into HDFS. (hadoop-examples.jar)
-    curl -X PUT --data-binary @hadoop-examples.jar 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/hadoop-examples.jar?user.name=hdfs&op=CREATE'
+    curl -X PUT --data-binary @hadoop-examples.jar 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/hadoop-examples.jar?user.name=hdfs&op=CREATE'
      */
     driver.createFile( user, pass, null, root+"/hadoop-examples.jar", "777", "application/octet-stream", "hadoop-examples.jar", 307, 201, 200 );
 
     /* Put the data file into HDFS (changes.txt)
-    curl -X PUT --data-binary @changes.txt 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/input/changes.txt?user.name=hdfs&op=CREATE'
+    curl -X PUT --data-binary @changes.txt 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/input/changes.txt?user.name=hdfs&op=CREATE'
      */
     driver.createFile( user, pass, null, root+"/input/changes.txt", "777", "text/plain", "changes.txt", 307, 201, 200 );
 
     /* Create the output directory
-    curl -X PUT 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/output?op=MKDIRS&user.name=hdfs'
+    curl -X PUT 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/output?op=MKDIRS&user.name=hdfs'
     */
     driver.createDir( user, pass, null, root+"/output", "777", 200, 200 );
 
@@ -704,7 +704,7 @@ public class GatewayBasicFuncTest {
 
     // Can't really check for the output here because the job won't be done.
     /* Retrieve results
-    curl 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/input?op=LISTSTATUS'
+    curl 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/input?op=LISTSTATUS'
     */
 
     if( CLEANUP_TEST ) {
@@ -789,12 +789,12 @@ public class GatewayBasicFuncTest {
     driver.createFile( user, pass, group, root+"/workflow.xml", "666", "application/octet-stream", "oozie-workflow.xml", 307, 201, 200 );
 
     /* Put the mapreduce code into HDFS. (hadoop-examples.jar)
-    curl -X PUT --data-binary @hadoop-examples.jar 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/hadoop-examples.jar?user.name=hdfs&op=CREATE'
+    curl -X PUT --data-binary @hadoop-examples.jar 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/hadoop-examples.jar?user.name=hdfs&op=CREATE'
      */
     driver.createFile( user, pass, group, root+"/lib/hadoop-examples.jar", "777", "application/octet-stream", "hadoop-examples.jar", 307, 201, 200 );
 
     /* Put the data file into HDFS (changes.txt)
-    curl -X PUT --data-binary @changes.txt 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/namenode/api/v1/user/hdfs/wordcount/input/changes.txt?user.name=hdfs&op=CREATE'
+    curl -X PUT --data-binary @changes.txt 'http://192.168.1.163:8888/org.apache.org.apache.hadoop.gateway/cluster/webhdfs/v1/user/hdfs/wordcount/input/changes.txt?user.name=hdfs&op=CREATE'
      */
     driver.createFile( user, pass, group, root+"/input/changes.txt", "666", "text/plain", "changes.txt", 307, 201, 200 );
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
index 4198125..d2e1ca8 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/deploy/DeploymentFactoryFuncTest.java
@@ -19,7 +19,6 @@ package org.apache.hadoop.gateway.deploy;
 
 import org.apache.hadoop.gateway.GatewayTestConfig;
 import org.apache.hadoop.gateway.config.GatewayConfig;
-import org.apache.hadoop.gateway.config.impl.GatewayConfigImpl;
 import org.apache.hadoop.gateway.services.DefaultGatewayServices;
 import org.apache.hadoop.gateway.services.ServiceLifecycleException;
 import org.apache.hadoop.gateway.topology.Provider;
@@ -35,7 +34,6 @@ import org.xml.sax.SAXException;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -113,7 +111,7 @@ public class DeploymentFactoryFuncTest {
 
     Document gateway = parse( war.get( "WEB-INF/gateway.xml" ).getAsset().openStream() );
 
-    assertThat( gateway, hasXPath( "/gateway/resource[1]/pattern", equalTo( "/namenode/api/v1/?**" ) ) );
+    assertThat( gateway, hasXPath( "/gateway/resource[1]/pattern", equalTo( "/webhdfs/v1/?**" ) ) );
     //assertThat( gateway, hasXPath( "/gateway/resource[1]/target", equalTo( "http://localhost:50070/webhdfs/v1/?{**}" ) ) );
 
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[1]/role", equalTo( "authentication" ) ) );
@@ -139,7 +137,7 @@ public class DeploymentFactoryFuncTest {
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/name", equalTo( "http-client" ) ) );
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.dispatch.HttpClientDispatch" ) ) );
 
-    assertThat( gateway, hasXPath( "/gateway/resource[2]/pattern", equalTo( "/namenode/api/v1/**?**" ) ) );
+    assertThat( gateway, hasXPath( "/gateway/resource[2]/pattern", equalTo( "/webhdfs/v1/**?**" ) ) );
     //assertThat( gateway, hasXPath( "/gateway/resource[2]/target", equalTo( "http://localhost:50070/webhdfs/v1/{path=**}?{**}" ) ) );
 
     assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[1]/role", equalTo( "authentication" ) ) );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
index 912c4ea..1a600a3 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
@@ -613,14 +613,14 @@ public class MatcherTest {
     Matcher<String> stringMatcher;
     Matcher<?>.Match match;
 
-//    template = Parser.parse( "*://*:*/**/namenode/api/v1/**?**" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/namenode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
+//    template = Parser.parse( "*://*:*/**/webhdfs/v1/**?**" );
+//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
 //    matcher = new Matcher<String>( template, "test-value" );
 //    match = matcher.match( input );
 //    assertThat( (String)match.getValue(), is( "test-value" ) );
 //
-//    template = Parser.parse( "*://*:*/**/namenode/api/v1/{path=**}?{**=*}" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/namenode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
+//    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
+//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
 //    matcher = new Matcher<String>( template, "test-value-2" );
 //    match = matcher.match( input );
 //    assertThat( (String)match.getValue(), is( "test-value-2" ) );
@@ -628,20 +628,20 @@ public class MatcherTest {
 //    stringMatcher = new Matcher<String>();
 //    template = Parser.parse( "*://*:*/**/datanode/api/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
 //    stringMatcher.add( template, "test-value-C" );
-//    template = Parser.parse( "*://*:*/**/namenode/api/v1/{path=**}?{**=*}" );
+//    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
 //    stringMatcher.add( template, "test-value-B" );
-//    input = Parser.parse( "http://localhost:53221/gateway/cluster/namenode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
+//    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
 //    match = stringMatcher.match( input );
 //    assertThat( match.getValue(), notNullValue() );
 //    assertThat( (String)match.getValue(), is( "test-value-B" ) );
 
     // This is just a reverse of the above.  The order caused a bug.
     stringMatcher = new Matcher<String>();
-    template = Parser.parse( "*://*:*/**/namenode/api/v1/{path=**}?{**=*}" );
+    template = Parser.parse( "*://*:*/**/webhdfs/v1/{path=**}?{**=*}" );
     stringMatcher.add( template, "test-value-B" );
     template = Parser.parse( "*://*:*/**/webhdfs/data/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
     stringMatcher.add( template, "test-value-C" );
-    input = Parser.parse( "http://localhost:53221/gateway/cluster/namenode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
+    input = Parser.parse( "http://localhost:53221/gateway/cluster/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
     match = stringMatcher.match( input );
     assertThat( match.getValue(), notNullValue() );
     assertThat( (String)match.getValue(), is( "test-value-B" ) );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
index 69fdf5b..dc03828 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
@@ -874,7 +874,7 @@ public class ParserTest {
     template = Parser.parse( "*://*:*/**/path?{**}" );
     assertThat( template, notNullValue() );
 
-    template = Parser.parse( "*://*:*/**/namenode/api/v1/?{**}" );
+    template = Parser.parse( "*://*:*/**/webhdfs/v1/?{**}" );
     assertThat( template, notNullValue() );
 
   }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a6fdb19f/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
index 58e7f1c..8d031c2 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
@@ -221,24 +221,24 @@ public class RewriterTest {
     expectOutput = new URI( "http://some-other-host/pathC/pathB/filter-queryParam-value/expect-queryParam-value" );
     assertThat( actualOutput, equalTo( expectOutput ) );
 
-    actualInput = new URI( "/namenode/api/v1/test" );
-    sourcePattern = Parser.parse( "/namenode/api/v1/{0=**}" );
+    actualInput = new URI( "/webhdfs/v1/test" );
+    sourcePattern = Parser.parse( "/webhdfs/v1/{0=**}" );
     targetPattern = Parser.parse( "http://{filter-queryParam-name}/webhdfs/v1/{0}" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     expectOutput = new URI( "http://filter-queryParam-value/webhdfs/v1/test" );
     assertThat( actualOutput, equalTo( expectOutput ) );
 
-    actualInput = new URI( "/namenode/api/v1/test" );
-    sourcePattern = Parser.parse( "/namenode/api/v1/{0=**}" );
+    actualInput = new URI( "/webhdfs/v1/test" );
+    sourcePattern = Parser.parse( "/webhdfs/v1/{0=**}" );
     targetPattern = Parser.parse( "http://{filter-queryParam-name}/webhdfs/v1/{0}" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     expectOutput = new URI( "http://filter-queryParam-value/webhdfs/v1/test" );
     assertThat( actualOutput, equalTo( expectOutput ) );
 
     actualInput = new URI( "http://vm.home:50075/webhdfs/v1/test/file?op=CREATE&user.name=hdfs&overwrite=false" );
-    expectOutput = new URI( "http://filter-queryParam-value/gatewaycluster/namenode/api/v1/test/file?op=CREATE&user.name=hdfs&overwrite=false" );
+    expectOutput = new URI( "http://filter-queryParam-value/gatewaycluster/webhdfs/v1/test/file?op=CREATE&user.name=hdfs&overwrite=false" );
     sourcePattern = Parser.parse( "*://*:*/webhdfs/v1/{path=**}?op={op=*}&user.name={username=*}&overwrite={overwrite=*}" );
-    targetPattern = Parser.parse( "http://{filter-queryParam-name}/gatewaycluster/namenode/api/v1/{path=**}?op={op}&user.name={username}&overwrite={overwrite}" );
+    targetPattern = Parser.parse( "http://{filter-queryParam-name}/gatewaycluster/webhdfs/v1/{path=**}?op={op}&user.name={username}&overwrite={overwrite}" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     assertThat( actualOutput, equalTo( expectOutput ) );
 
@@ -254,7 +254,7 @@ public class RewriterTest {
     assertThat( actualOutput, equalTo( expectOutput ) );
 
     // *://**/webhdfs/v1/{path=**}?**={**}
-    // http://{org.apache.org.apache.hadoop.gateway.address}/gatewaycluster/namenode/api/v1/{path}?**={**}
+    // http://{org.apache.org.apache.hadoop.gateway.address}/gatewaycluster/webhdfs/v1/{path}?**={**}
     // 1) Should not add query if none in source.
     // 2) Should only add unmatch query parameters
     // Consider chaning = within {} to : and wrapping query fully within {} (e.g. {query=pattern:alias}


[6/8] git commit: KNOX-42: Changed Oozie URLs.

Posted by km...@apache.org.
KNOX-42: Changed Oozie URLs.


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

Branch: refs/heads/master
Commit: 1ea67de774e1ab18f90a3391282265c8ae458318
Parents: e7e518e
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 24 10:32:43 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:16 2013 -0400

----------------------------------------------------------------------
 .../apache/hadoop/gateway/filter/rewrite/impl/rewrite.xml    | 6 +++---
 .../main/java/org/apache/hadoop/gateway/GatewayMessages.java | 8 ++++----
 .../org/apache/hadoop/gateway/deploy/DeploymentFactory.java  | 2 +-
 .../hadoop/gateway/oozie/OozieDeploymentContributor.java     | 2 +-
 .../gateway/oozie/OozieDeploymentContributor/rewrite.xml     | 4 ++--
 .../org/apache/hadoop/gateway/shell/workflow/Workflow.java   | 2 +-
 .../java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/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 a61820f..1d58a25 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
@@ -96,11 +96,11 @@
     <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/templeton/{version}/{path=**}?{**}">
         <rewrite template="http://vm:50111/templeton/{version}/{path=**}?{**}"/>
     </rule>
-    <rule dir="IN" name="OOZIE/oozie/root/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">
+    <rule dir="IN" name="OOZIE/oozie/root/inbound" pattern="*://*:*/**/oozie/{**}?{**}">
         <rewrite template="http://vm:11000/oozie/{**}?{**}"/>
     </rule>
-    <rule dir="IN" name="OOZIE/oozie/api/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">
-        <rewrite template="http://vm:11000/oozie/{**}?{**}"/>
+    <rule dir="IN" name="OOZIE/oozie/v1/inbound" pattern="*://*:*/**/oozie/v1/{**}?{**}">
+        <rewrite template="http://vm:11000/oozie/v1/{**}?{**}"/>
     </rule>
 
 </rules>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/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 be755ad..2120bbf 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
@@ -165,11 +165,11 @@ public interface GatewayMessages {
   @Message( level = MessageLevel.ERROR, text = "Failed to finalize contribution: {0}" )
   void failedToFinalizeContribution( @StackTrace( level = MessageLevel.DEBUG ) Exception e );
 
-  @Message( level = MessageLevel.ERROR, text = "Failed to contribute service [name={0}, role={1}]: {2}" )
-  void failedToContributeService( String name, String role, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
+  @Message( level = MessageLevel.ERROR, text = "Failed to contribute service [role={1}, name={0}]: {2}" )
+  void failedToContributeService( String name, String role, @StackTrace( level = MessageLevel.ERROR ) Exception e );
 
-  @Message( level = MessageLevel.ERROR, text = "Failed to contribute provider [name={0}, role={1}]: {2}" )
-  void failedToContributeProvider( String name, String role, @StackTrace( level = MessageLevel.DEBUG ) Exception e );
+  @Message( level = MessageLevel.ERROR, text = "Failed to contribute provider [role={1}, name={0}]: {2}" )
+  void failedToContributeProvider( String name, String role, @StackTrace( level = MessageLevel.ERROR ) Exception e );
 
   @Message( level = MessageLevel.ERROR, text = "Failed to initialize contribution: {0}" )
   void failedToInitializeContribution( @StackTrace( level = MessageLevel.DEBUG ) Exception e );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
index 01f9663..3ee564b 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/DeploymentFactory.java
@@ -261,7 +261,7 @@ public abstract class DeploymentFactory {
         } catch( Exception e ) {
           // Maybe it makes sense to throw exception
           log.failedToContributeService( service.getName(), service.getRole(), e );
-          throw new DeploymentException("Failed to contribute provider.", e);
+          throw new DeploymentException("Failed to contribute service.", e);
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java b/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
index 6933ba3..7215945 100644
--- a/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
+++ b/gateway-service-oozie/src/main/java/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor.java
@@ -36,7 +36,7 @@ import java.util.List;
 public class OozieDeploymentContributor extends ServiceDeploymentContributorBase {
 
   private static final String RULES_RESOURCE = OozieDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
-  private static final String EXTERNAL_PATH = "/oozie/api";
+  private static final String EXTERNAL_PATH = "/oozie";
 
   @Override
   public String getRole() {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
index b129326..dac2e51 100644
--- a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
+++ b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
@@ -16,11 +16,11 @@
 -->
 <rules>
 
-    <rule dir="IN" name="OOZIE/oozie/root" pattern="*://*:*/**/oozie/api/{**}?{**}">
+    <rule dir="IN" name="OOZIE/oozie/root" pattern="*://*:*/**/oozie/{**}?{**}">
         <rewrite template="{$serviceUrl[OOZIE]}/{**}?{**}"/>
     </rule>
 
-    <rule dir="IN" name="OOZIE/oozie/api" pattern="*://*:*/**/oozie/api/v1/{**}?{**}">
+    <rule dir="IN" name="OOZIE/oozie/v1" pattern="*://*:*/**/oozie/v1/{**}?{**}">
         <rewrite template="{$serviceUrl[OOZIE]}/v1/{**}?{**}"/>
     </rule>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/workflow/Workflow.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/workflow/Workflow.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/workflow/Workflow.java
index 2e0d09c..a132e9f 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/workflow/Workflow.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/workflow/Workflow.java
@@ -21,7 +21,7 @@ import org.apache.hadoop.gateway.shell.Hadoop;
 
 public class Workflow {
 
-  static String SERVICE_PATH = "/oozie/api/v1";
+  static String SERVICE_PATH = "/oozie/v1";
 
   public static Submit.Request submit( Hadoop session ) {
     return new Submit.Request( session );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/1ea67de7/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 32f1a30..4c9b33e 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
@@ -120,7 +120,7 @@ public class GatewayBasicFuncTest {
     driver.setupService( "WEBHDFS", "http://" + TEST_HOST + ":50070/webhdfs", "/cluster/webhdfs", USE_MOCK_SERVICES );
     driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/webhdfs/data", USE_MOCK_SERVICES );
     driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton", USE_MOCK_SERVICES );
-    driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie/api", USE_MOCK_SERVICES );
+    driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie", USE_MOCK_SERVICES );
     driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive/api/v1", USE_MOCK_SERVICES );
     driver.setupService( "STARGATE", "http://" + TEST_HOST + ":60080", "/cluster/hbase", USE_MOCK_SERVICES );
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );


[5/8] git commit: KNOX-42: Changed Hive URLs.

Posted by km...@apache.org.
KNOX-42: Changed Hive URLs.


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

Branch: refs/heads/master
Commit: d6d6c194cc29be1347f9ab50ee6e33591f963c69
Parents: 1ea67de
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 24 10:41:57 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:16 2013 -0400

----------------------------------------------------------------------
 .../home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java        | 2 +-
 .../org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java  | 2 +-
 .../test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/d6d6c194/gateway-release/home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java b/gateway-release/home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java
index fd5a97a..d1eaacf 100644
--- a/gateway-release/home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java
+++ b/gateway-release/home/samples/hive/java/jdbc/sandbox/HiveJDBCSample.java
@@ -37,7 +37,7 @@ public class HiveJDBCSample {
       String password = user + "-password";
       String gatewayHost = "localhost";
       int gatewayPort = 8443;
-      String contextPath = "gateway/sandbox/hive/api/v1";
+      String contextPath = "gateway/sandbox/hive";
       String connectionString = String.format( "jdbc:hive2://%s:%d/?hive.server2.servermode=https;hive.server2.http.path=%s", gatewayHost, gatewayPort, contextPath );
 
       // Load Hive JDBC Driver

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/d6d6c194/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
index 898392d..fb59c27 100644
--- a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
+++ b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDeploymentContributor.java
@@ -31,7 +31,7 @@ public class HiveDeploymentContributor extends ServiceDeploymentContributorBase
 
   private static final String ROLE = "HIVE";
   private static final String NAME = "hive";
-  private static final String EXTERNAL_PATH = "/hive/api/v1";
+  private static final String EXTERNAL_PATH = "/hive";
 
   @Override
   public String getRole() {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/d6d6c194/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 4c9b33e..ed99966 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( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/webhdfs/data", USE_MOCK_SERVICES );
     driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton", USE_MOCK_SERVICES );
     driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie", USE_MOCK_SERVICES );
-    driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive/api/v1", USE_MOCK_SERVICES );
+    driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive", USE_MOCK_SERVICES );
     driver.setupService( "STARGATE", "http://" + TEST_HOST + ":60080", "/cluster/hbase", USE_MOCK_SERVICES );
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );
     driver.setupService( "JOBTRACKER", "thrift://" + TEST_HOST + ":8021", null, USE_MOCK_SERVICES );


[7/8] git commit: KNOX-42: Changed Hive URLs.

Posted by km...@apache.org.
KNOX-42: Changed Hive URLs.


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

Branch: refs/heads/master
Commit: e7e518e2602ee87be63262474aa47be2ffdddd3f
Parents: e5484ea
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 24 08:58:01 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:16 2013 -0400

----------------------------------------------------------------------
 .../filter/rewrite/i18n/UrlRewriteMessages.java |   2 +-
 .../apache/hadoop/gateway/GatewayFilter.java    |   2 +
 .../apache/hadoop/gateway/GatewayMessages.java  |  12 +-
 .../gateway/dispatch/HttpClientDispatch.java    |  28 +++--
 .../hbase/HBaseDeploymentContributor.java       |   2 +-
 .../HBaseDeploymentContributor/rewrite.xml      |  13 +-
 .../hadoop/gateway/shell/hbase/HBase.java       |   2 +-
 .../hadoop/gateway/GatewayBasicFuncTest.java    |   2 +-
 .../gateway/util/urltemplate/Segment.java       | 118 ++++++++++---------
 .../gateway/util/urltemplate/MatcherTest.java   |  33 ++++++
 .../gateway/util/urltemplate/SegmentTest.java   |  10 +-
 11 files changed, 141 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/i18n/UrlRewriteMessages.java
----------------------------------------------------------------------
diff --git a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/i18n/UrlRewriteMessages.java b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/i18n/UrlRewriteMessages.java
index 215e54c..1af7974 100644
--- a/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/i18n/UrlRewriteMessages.java
+++ b/gateway-provider-rewrite/src/main/java/org/apache/hadoop/gateway/filter/rewrite/i18n/UrlRewriteMessages.java
@@ -79,7 +79,7 @@ public interface UrlRewriteMessages {
   @Message( level = MessageLevel.ERROR, text = "Failed to rewrite URL: {0}, direction: {1}, rule: {2}" )
   void failedToRewriteUrlDueToException( Template inputUri, UrlRewriter.Direction direction, String ruleName, @StackTrace(level = MessageLevel.DEBUG) Exception exception );
 
-  @Message( level = MessageLevel.DEBUG, text = "No rule matching URL: {0}, direction: {1}" )
+  @Message( level = MessageLevel.TRACE, text = "No rule matching URL: {0}, direction: {1}" )
   void noRuleMatchingUrl( Template inputUri, UrlRewriter.Direction direction );
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayFilter.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayFilter.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayFilter.java
index 17ef5b9..87dd8f2 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayFilter.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayFilter.java
@@ -89,6 +89,8 @@ public class GatewayFilter implements Filter {
       throw new ServletException( e );
     }
 
+    LOG.receivedRequest( httpRequest.getMethod(), pathTemplate );
+
     servletRequest.setAttribute( AbstractGatewayFilter.SOURCE_REQUEST_URL_ATTRIBUTE_NAME, pathTemplate );
 
     Matcher<Chain>.Match match = chains.match( pathTemplate );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/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 82f4b57..be755ad 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
@@ -23,6 +23,7 @@ import org.apache.hadoop.gateway.i18n.messages.MessageLevel;
 import org.apache.hadoop.gateway.i18n.messages.Messages;
 import org.apache.hadoop.gateway.i18n.messages.StackTrace;
 import org.apache.hadoop.gateway.services.security.KeystoreServiceException;
+import org.apache.hadoop.gateway.util.urltemplate.Template;
 
 import java.io.File;
 import java.net.URI;
@@ -143,7 +144,10 @@ public interface GatewayMessages {
   @Message( level = MessageLevel.INFO, text = "Credential store found for the cluster: {0} - no need to create one." )
   void credentialStoreForClusterFoundNotCreating(String clusterName);
 
-  @Message( level = MessageLevel.DEBUG, text = "Dispatching request: {0} {1}" )
+  @Message( level = MessageLevel.INFO, text = "Received request: {0} {1}" )
+  void receivedRequest( String method, Template uri );
+
+  @Message( level = MessageLevel.INFO, text = "Dispatch request: {0} {1}" )
   void dispatchRequest( String method, URI uri );
   
   @Message( level = MessageLevel.WARN, text = "Connection exception dispatching request: {0} {1}" )
@@ -260,9 +264,12 @@ 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 = "Dispatch response status: {0}" )
+  @Message( level = MessageLevel.INFO, text = "Dispatch response status: {0}" )
   void dispatchResponseStatusCode(int statusCode);
 
+  @Message( level = MessageLevel.INFO, text = "Dispatch response status: {0}, Location: {1}" )
+  void dispatchResponseCreatedStatusCode( int statusCode, String location );
+
   @Message( level = MessageLevel.ERROR, text = "Failed to decrypt cipher text for cluster {0}: due to inability to retrieve the password." )
   void failedToDecryptCipherForClusterNullPassword(String clusterName);
 
@@ -280,4 +287,5 @@ public interface GatewayMessages {
 
   @Message( level = MessageLevel.ERROR, text = "Failed to generate alias for cluster: {0} {1}." )
   void failedToGenerateAliasForCluster(String clusterName, KeystoreServiceException e);
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
index 1cd0a51..4ef336a 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
@@ -17,15 +17,6 @@
  */
 package org.apache.hadoop.gateway.dispatch;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 import org.apache.hadoop.gateway.GatewayMessages;
 import org.apache.hadoop.gateway.GatewayResources;
 import org.apache.hadoop.gateway.config.GatewayConfig;
@@ -35,7 +26,6 @@ import org.apache.http.Header;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
-import org.apache.http.auth.Credentials;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.HttpDelete;
 import org.apache.http.client.methods.HttpGet;
@@ -49,6 +39,13 @@ import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.impl.client.DefaultHttpClient;
 import org.apache.http.message.BasicHeader;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+
 /**
  *
  */
@@ -98,7 +95,16 @@ public class HttpClientDispatch extends AbstractGatewayDispatch {
     } finally {
       if (inboundResponse != null) {
         int statusCode = inboundResponse.getStatusLine().getStatusCode();
-        LOG.dispatchResponseStatusCode( statusCode );
+        if( statusCode != 201 ) {
+          LOG.dispatchResponseStatusCode( statusCode );
+        } else {
+          Header location = inboundResponse.getFirstHeader( "Location" );
+          if( location == null ) {
+            LOG.dispatchResponseStatusCode( statusCode );
+          } else {
+            LOG.dispatchResponseCreatedStatusCode( statusCode, location.getValue() );
+          }
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
index 4dc6a49..7cc9dc7 100644
--- a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
+++ b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
@@ -36,7 +36,7 @@ import java.util.List;
 public class HBaseDeploymentContributor extends ServiceDeploymentContributorBase {
 
   private static final String RULES_RESOURCE = HBaseDeploymentContributor.class.getName().replace( '.', '/' ) + "/rewrite.xml";
-  private static final String EXTERNAL_PATH = "/hbase/api/v1";
+  private static final String EXTERNAL_PATH = "/hbase";
   private static final String CLUSTER_URL_FUNCTION = "{gateway.url}";
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml b/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
index ef88bcb..1a1236f 100644
--- a/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
+++ b/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
@@ -16,19 +16,22 @@
 -->
 <rules>
 
-    <rule dir="IN" name="STARGATE/stargate/root/inbound" pattern="*://*:*/**/hbase/api/v1/?{**}">
+    <rule dir="IN" name="STARGATE/stargate/root/inbound" pattern="*://*:*/**/hbase/?{**}">
         <rewrite template="{$serviceUrl[STARGATE]}/?{**}"/>
     </rule>
-    <rule dir="IN" name="STARGATE/stargate/path/inbound" pattern="*://*:*/**/hbase/api/v1/{**}?{**}">
-        <rewrite template="{$serviceUrl[STARGATE]}/{**}?{**}"/>
+
+    <rule dir="IN" name="STARGATE/stargate/path/inbound" pattern="*://*:*/**/hbase/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[STARGATE]}/{path=**}?{**}"/>
     </rule>
+
     <rule name="STARGATE/stargate/location/outbound">
         <match pattern="*://*:*/{path=**}?{**}"/>
-        <rewrite template="{gateway.url}/hbase/api/v1/{path}?{**}"/>
+        <rewrite template="{gateway.url}/hbase/{path=**}?{**}"/>
     </rule>
+
     <rule name="STARGATE/stargate/address/outbound">
         <match pattern="{host}:{port}"/>
-        <rewrite template="{gateway.url}/hbase/region?host={host}?port={port}"/>
+        <rewrite template="{gateway.url}/hbase-region?host={host}?port={port}"/>
         <encrypt-query/>
     </rule>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hbase/HBase.java
----------------------------------------------------------------------
diff --git a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hbase/HBase.java b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hbase/HBase.java
index a86d055..09f3e7e 100644
--- a/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hbase/HBase.java
+++ b/gateway-shell/src/main/java/org/apache/hadoop/gateway/shell/hbase/HBase.java
@@ -21,7 +21,7 @@ import org.apache.hadoop.gateway.shell.hbase.table.Table;
 
 public class HBase {
 
-  public static final String SERVICE_PATH = "/hbase/api/v1";
+  public static final String SERVICE_PATH = "/hbase";
 
   private Hadoop session;
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/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 77f70e2..32f1a30 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
@@ -122,7 +122,7 @@ public class GatewayBasicFuncTest {
     driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton", 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 + ":60080", "/cluster/hbase/api/v1", USE_MOCK_SERVICES );
+    driver.setupService( "STARGATE", "http://" + TEST_HOST + ":60080", "/cluster/hbase", USE_MOCK_SERVICES );
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );
     driver.setupService( "JOBTRACKER", "thrift://" + TEST_HOST + ":8021", null, USE_MOCK_SERVICES );
     driver.setupGateway( config, "cluster", createTopology(), USE_GATEWAY );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Segment.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Segment.java b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Segment.java
index 8f5412b..462011f 100644
--- a/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Segment.java
+++ b/gateway-util-urltemplate/src/main/java/org/apache/hadoop/gateway/util/urltemplate/Segment.java
@@ -158,15 +158,18 @@ abstract class Segment {
       if( matches ) {
         switch( this.getType() ) {
           case( STATIC ):
-            matches = matchThisStatic( that );
+            matches = this.pattern.equals( that.pattern );
+            //matches = matchThisStatic( that ); // See: MatcherTest.testWildcardCharacterInInputTemplate
             break;
           case( DEFAULT ):
           case( STAR ):
           case( GLOB ):
-            matches = matchThisWildcard( that );
+            matches = true;
+            //matches = matchThisWildcard( that ); // See: MatcherTest.testWildcardCharacterInInputTemplate
             break;
           case( REGEX ):
-            matches = matchThisRegex( that );
+            matches = this.regex.matcher( that.pattern ).matches();
+            //matches = matchThisRegex( that ); // See: MatcherTest.testWildcardCharacterInInputTemplate
             break;
           default:
             matches = false;
@@ -175,59 +178,62 @@ abstract class Segment {
       return matches;
     }
 
-    private boolean matchThisStatic( Value that ) {
-      boolean matches = false;
-      switch( that.getType() ) {
-        case( STATIC ):
-          matches = this.pattern.equals( that.pattern );
-          break;
-        case( DEFAULT ):
-        case( STAR ):
-        case( GLOB ):
-          matches = true;
-          break;
-        case( REGEX ):
-          matches = that.regex.matcher( this.pattern ).matches();
-          break;
-      }
-      return matches;
-    }
-
-    private boolean matchThisWildcard( Value that ) {
-      boolean matches = false;
-      switch( that.getType() ) {
-        case( STATIC ):
-          matches = true;
-          break;
-        case( DEFAULT ):
-        case( STAR ):
-        case( GLOB ):
-          matches = true;
-          break;
-        case( REGEX ):
-          matches = true;
-          break;
-      }
-      return matches;
-    }
-
-    private boolean matchThisRegex( Value that ) {
-      boolean matches = false;
-      switch( that.getType() ) {
-        case( STATIC ):
-          matches = this.regex.matcher( that.pattern ).matches();
-          break;
-        case( DEFAULT ):
-        case( STAR ):
-        case( GLOB ):
-          matches = true;
-          break;
-        case( REGEX ):
-          matches =  this.pattern.equals( that.pattern );
-          break;
-      }
-      return matches;
-    }
+// See: MatcherTest.testWildcardCharacterInInputTemplate
+//    private boolean matchThisStatic( Value that ) {
+//      boolean matches = false;
+//      switch( that.getType() ) {
+//        case( STATIC ):
+//          matches = this.pattern.equals( that.pattern );
+//          break;
+//        case( DEFAULT ):
+//        case( STAR ):
+//        case( GLOB ):
+//          matches = true;
+//          break;
+//        case( REGEX ):
+//          matches = that.regex.matcher( this.pattern ).matches();
+//          break;
+//      }
+//      return matches;
+//    }
+
+// See: MatcherTest.testWildcardCharacterInInputTemplate
+//    private boolean matchThisWildcard( Value that ) {
+//      boolean matches = false;
+//      switch( that.getType() ) {
+//        case( STATIC ):
+//          matches = true;
+//          break;
+//        case( DEFAULT ):
+//        case( STAR ):
+//        case( GLOB ):
+//          matches = true;
+//          break;
+//        case( REGEX ):
+//          matches = true;
+//          break;
+//      }
+//      return matches;
+//    }
+
+// See: MatcherTest.testWildcardCharacterInInputTemplate
+//    private boolean matchThisRegex( Value that ) {
+//      boolean matches = false;
+//      switch( that.getType() ) {
+//        case( STATIC ):
+//          matches = this.regex.matcher( that.pattern ).matches();
+//          break;
+//        case( DEFAULT ):
+//        case( STAR ):
+//        case( GLOB ):
+//          matches = true;
+//          break;
+//        case( REGEX ):
+//          matches =  this.pattern.equals( that.pattern );
+//          break;
+//      }
+//      return matches;
+//    }
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
index 1a600a3..03dcb19 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
@@ -53,6 +53,39 @@ public class MatcherTest {
   }
 
   @Test
+  public void testWildcardCharacterInInputTemplate() throws URISyntaxException {
+    Matcher<String> matcher;
+    Template patternTemplate, inputTemplate;
+    Matcher<String>.Match match;
+
+    // First verify that if .../test_table/test_row/family1... works.
+    matcher = new Matcher<String>();
+    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/test_row/family1:row2_col1,family2/0,9223372036854775807?v=1" );
+    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
+    matcher.add( patternTemplate, "webhdfs" );
+    match = matcher.match( inputTemplate );
+    assertThat( match, nullValue() );
+
+    // Then reproduce the issue with .../test_table/*/family1..
+    matcher = new Matcher<String>();
+    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/*/family1:row2_col1,family2/0,9223372036854775807?v=1" );
+    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
+    matcher.add( patternTemplate, "webhdfs" );
+    match = matcher.match( inputTemplate );
+    assertThat( match, nullValue() );
+
+    // Reproduce the issue where the wrong match was picked when there was a "*" in the input URL template.
+    matcher = new Matcher<String>();
+    inputTemplate = Parser.parse( "https://localhost:8443/gateway/sandbox/hbase/test_table/*/family1:row2_col1,family2/0,9223372036854775807?v=1" );
+    patternTemplate = Parser.parse( "*://*:*/**/webhdfs/{version}/{path=**}?{**}" );
+    matcher.add( patternTemplate, "webhdfs" );
+    patternTemplate = Parser.parse( "*://*:*/**/hbase/{path=**}?{**}" );
+    matcher.add( patternTemplate, "hbase" );
+    match = matcher.match( inputTemplate );
+    assertThat( match.getValue(), is( "hbase" ) );
+  }
+
+  @Test
   public void testRootPathMatching() throws Exception {
     Matcher<String> matcher;
     Template patternTemplate, inputTemplate;

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/e7e518e2/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/SegmentTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/SegmentTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/SegmentTest.java
index 4f14197..a563181 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/SegmentTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/SegmentTest.java
@@ -59,24 +59,24 @@ public class SegmentTest {
 
     TestSegment s3 = new TestSegment( "p", "*" );
     assertThat( s3.matches( s1 ), equalTo( true ) );
-    assertThat( s1.matches( s3 ), equalTo( true ) );
+    assertThat( s1.matches( s3 ), equalTo( false ) ); // Because wildecards no longer supported in "that" segment.
 
     TestSegment s4 = new TestSegment( "p", "**" );
     assertThat( s4.matches( s1 ), equalTo( true ) );
-    assertThat( s1.matches( s4 ), equalTo( true ) );
+    assertThat( s1.matches( s4 ), equalTo( false ) ); // Because wildecards no longer supported in "that" segment.
 
     TestSegment s5 = new TestSegment( "p", "*.ext" );
     TestSegment s6 = new TestSegment( "p", "file.ext" );
     assertThat( s5.matches( s5 ), equalTo( true ) );
     assertThat( s5.matches( s6 ), equalTo( true ) );
-    assertThat( s6.matches( s5 ), equalTo( true ) );
+    assertThat( s6.matches( s5 ), equalTo( false ) ); // Because wildecards no longer supported in "that" segment.
 
     assertThat( s3.matches( s4 ), equalTo( true ) );
     assertThat( s4.matches( s3 ), equalTo( true ) );
     assertThat( s3.matches( s5 ), equalTo( true ) );
-    assertThat( s5.matches( s3 ), equalTo( true ) );
+    assertThat( s5.matches( s3 ), equalTo( false ) ); // Because wildecards no longer supported in "that" segment.
     assertThat( s4.matches( s5 ), equalTo( true ) );
-    assertThat( s5.matches( s4 ), equalTo( true ) );
+    assertThat( s5.matches( s4 ), equalTo( false ) ); // Because wildecards no longer supported in "that" segment.
 
 //    InvalidSegment s7 = new InvalidSegment( "p", "v", Integer.MAX_VALUE );
 //    InvalidSegment s8 = new InvalidSegment( "p", "v", Integer.MAX_VALUE-1 );


[8/8] git commit: KNOX-42: Change stargate to webhbase.

Posted by km...@apache.org.
KNOX-42: Change stargate to webhbase.


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

Branch: refs/heads/master
Commit: 7756104bca5eea99aee264c617a2bf2c8282e3e3
Parents: d6d6c19
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 24 11:03:27 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:16 2013 -0400

----------------------------------------------------------------------
 gateway-release/home/deployments/sandbox.xml    |   2 +-
 gateway-release/home/templates/sample.conf      |   2 +-
 gateway-release/home/templates/sample.xml       |   2 +-
 .../hbase/HBaseDeploymentContributor.java       |   8 +-
 .../HBaseDeploymentContributor/rewrite.xml      |  28 ++---
 .../OozieDeploymentContributor/rewrite.xml      |   4 +
 .../hadoop/gateway/GatewayBasicFuncTest.java    | 120 +++++++++----------
 hsso-release/home/deployments/sample.xml        |   2 +-
 hsso-release/home/templates/topology.xml        |   2 +-
 9 files changed, 87 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-release/home/deployments/sandbox.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/deployments/sandbox.xml b/gateway-release/home/deployments/sandbox.xml
index 1753b5e..d8766cf 100644
--- a/gateway-release/home/deployments/sandbox.xml
+++ b/gateway-release/home/deployments/sandbox.xml
@@ -86,7 +86,7 @@
         <url>http://localhost:11000/oozie</url>
     </service>
     <service>
-        <role>STARGATE</role>
+        <role>WEBHBASE</role>
         <url>http://localhost:60080</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-release/home/templates/sample.conf
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.conf b/gateway-release/home/templates/sample.conf
index e9506ee..9c3cd9d 100644
--- a/gateway-release/home/templates/sample.conf
+++ b/gateway-release/home/templates/sample.conf
@@ -69,7 +69,7 @@
         <value>http://localhost:11000/oozie</value>
     </property>
     <property>
-        <name>topology.service.STARGATE..url</name>
+        <name>topology.service.WEBHBASE..url</name>
         <value>http://localhost:60080</value>
     </property>
     <property>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-release/home/templates/sample.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.xml b/gateway-release/home/templates/sample.xml
index 1203f83..ec52fd9 100644
--- a/gateway-release/home/templates/sample.xml
+++ b/gateway-release/home/templates/sample.xml
@@ -63,7 +63,7 @@
         <url>http://localhost:11000/oozie</url>
     </service>
     <service>
-        <role>STARGATE</role>
+        <role>WEBHBASE</role>
         <url>http://localhost:60080/</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
index 7cc9dc7..e94c9f3 100644
--- a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
+++ b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor.java
@@ -41,12 +41,12 @@ public class HBaseDeploymentContributor extends ServiceDeploymentContributorBase
 
   @Override
   public String getRole() {
-    return "STARGATE";
+    return "WEBHBASE";
   }
 
   @Override
   public String getName() {
-    return "stargate";
+    return "webhbase";
   }
 
   @Override
@@ -56,9 +56,9 @@ public class HBaseDeploymentContributor extends ServiceDeploymentContributorBase
   }
 
   private void contributeRewriteRules( DeploymentContext context, Service service ) throws URISyntaxException, IOException {
-    UrlRewriteRulesDescriptor stargateRules = loadRulesFromTemplate();
+    UrlRewriteRulesDescriptor hbaseRules = loadRulesFromTemplate();
     UrlRewriteRulesDescriptor clusterRules = context.getDescriptor( "rewrite" );
-    clusterRules.addRules( stargateRules );
+    clusterRules.addRules( hbaseRules );
   }
 
   private void contributeResources( DeploymentContext context, Service service ) throws URISyntaxException {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml b/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
index 1a1236f..fabcef4 100644
--- a/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
+++ b/gateway-service-hbase/src/main/resources/org/apache/hadoop/gateway/hbase/HBaseDeploymentContributor/rewrite.xml
@@ -16,46 +16,46 @@
 -->
 <rules>
 
-    <rule dir="IN" name="STARGATE/stargate/root/inbound" pattern="*://*:*/**/hbase/?{**}">
-        <rewrite template="{$serviceUrl[STARGATE]}/?{**}"/>
+    <rule dir="IN" name="WEBHBASE/webhbase/root/inbound" pattern="*://*:*/**/hbase/?{**}">
+        <rewrite template="{$serviceUrl[WEBHBASE]}/?{**}"/>
     </rule>
 
-    <rule dir="IN" name="STARGATE/stargate/path/inbound" pattern="*://*:*/**/hbase/{path=**}?{**}">
-        <rewrite template="{$serviceUrl[STARGATE]}/{path=**}?{**}"/>
+    <rule dir="IN" name="WEBHBASE/webhbase/path/inbound" pattern="*://*:*/**/hbase/{path=**}?{**}">
+        <rewrite template="{$serviceUrl[WEBHBASE]}/{path=**}?{**}"/>
     </rule>
 
-    <rule name="STARGATE/stargate/location/outbound">
+    <rule name="WEBHBASE/webhbase/location/outbound">
         <match pattern="*://*:*/{path=**}?{**}"/>
         <rewrite template="{gateway.url}/hbase/{path=**}?{**}"/>
     </rule>
 
-    <rule name="STARGATE/stargate/address/outbound">
+    <rule name="WEBHBASE/webhbase/address/outbound">
         <match pattern="{host}:{port}"/>
         <rewrite template="{gateway.url}/hbase-region?host={host}?port={port}"/>
         <encrypt-query/>
     </rule>
 
-    <filter name="STARGATE/stargate/headers/outbound">
+    <filter name="WEBHBASE/webhbase/headers/outbound">
         <content type="application/x-http-headers">
-            <apply path="Location" rule="STARGATE/stargate/location/outbound"/>
+            <apply path="Location" rule="WEBHBASE/webhbase/location/outbound"/>
         </content>
     </filter>
 
-    <filter name="STARGATE/stargate/status/outbound">
+    <filter name="WEBHBASE/webhbase/status/outbound">
         <content type="*/json">
-            <apply path="$[LiveNodes][*][name]" rule="STARGATE/stargate/address/outbound"/>
+            <apply path="$[LiveNodes][*][name]" rule="WEBHBASE/webhbase/address/outbound"/>
         </content>
         <content type="*/xml">
-            <apply path="/ClusterStatus/LiveNodes/Node/@name" rule="STARGATE/stargate/address/outbound"/>
+            <apply path="/ClusterStatus/LiveNodes/Node/@name" rule="WEBHBASE/webhbase/address/outbound"/>
         </content>
     </filter>
 
-    <filter name="STARGATE/stargate/regions/outbound">
+    <filter name="WEBHBASE/webhbase/regions/outbound">
         <content type="*/json">
-            <apply path="$[Region][*][location]" rule="STARGATE/stargate/address/outbound"/>
+            <apply path="$[Region][*][location]" rule="WEBHBASE/webhbase/address/outbound"/>
         </content>
         <content type="*/xml">
-            <apply path="/TableInfo/Region/@location" rule="STARGATE/stargate/address/outbound"/>
+            <apply path="/TableInfo/Region/@location" rule="WEBHBASE/webhbase/address/outbound"/>
         </content>
     </filter>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
----------------------------------------------------------------------
diff --git a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
index dac2e51..b7abde6 100644
--- a/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
+++ b/gateway-service-oozie/src/main/resources/org/apache/hadoop/gateway/oozie/OozieDeploymentContributor/rewrite.xml
@@ -24,6 +24,10 @@
         <rewrite template="{$serviceUrl[OOZIE]}/v1/{**}?{**}"/>
     </rule>
 
+    <rule dir="IN" name="OOZIE/oozie/v2" pattern="*://*:*/**/oozie/v2/{**}?{**}">
+        <rewrite template="{$serviceUrl[OOZIE]}/v2/{**}?{**}"/>
+    </rule>
+
     <rule name="OOZIE/oozie/user-name">
         <rewrite template="{$username}"/>
     </rule>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/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 ed99966..ff39b09 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
@@ -122,7 +122,7 @@ public class GatewayBasicFuncTest {
     driver.setupService( "WEBHCAT", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton", USE_MOCK_SERVICES );
     driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie", USE_MOCK_SERVICES );
     driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive", USE_MOCK_SERVICES );
-    driver.setupService( "STARGATE", "http://" + TEST_HOST + ":60080", "/cluster/hbase", USE_MOCK_SERVICES );
+    driver.setupService( "WEBHBASE", "http://" + TEST_HOST + ":60080", "/cluster/hbase", USE_MOCK_SERVICES );
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );
     driver.setupService( "JOBTRACKER", "thrift://" + TEST_HOST + ":8021", null, USE_MOCK_SERVICES );
     driver.setupGateway( config, "cluster", createTopology(), USE_GATEWAY );
@@ -204,8 +204,8 @@ public class GatewayBasicFuncTest {
             .addTag( "role" ).addText( "HIVE" )
             .addTag( "url" ).addText( driver.getRealUrl( "HIVE" ) ).gotoParent()
           .addTag( "service" )
-            .addTag( "role" ).addText( "STARGATE" )
-            .addTag( "url" ).addText( driver.getRealUrl( "STARGATE" ) )
+            .addTag( "role" ).addText( "WEBHBASE" )
+            .addTag( "url" ).addText( driver.getRealUrl( "WEBHBASE" ) )
         .gotoRoot();
     // System.out.println( "GATEWAY=" + xml.toString() );
     return xml;
@@ -1241,7 +1241,7 @@ public class GatewayBasicFuncTest {
     String password = "hbase-password";
     String resourceName = "hbase/table-list";
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( "/" )
@@ -1257,7 +1257,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.XML )
-    .when().get( driver.getUrl( "STARGATE" ) );
+    .when().get( driver.getUrl( "WEBHBASE" ) );
     
     MatcherAssert
         .assertThat(
@@ -1265,7 +1265,7 @@ public class GatewayBasicFuncTest {
             isEquivalentTo( the( driver.getResourceString( resourceName + ".xml", UTF8 ) ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( "/" )
@@ -1281,13 +1281,13 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.JSON )
-    .when().get( driver.getUrl( "STARGATE" ) );
+    .when().get( driver.getUrl( "WEBHBASE" ) );
     
     MatcherAssert
     .assertThat( response.getBody().asString(), sameJSONAs( driver.getResourceString( resourceName + ".json", UTF8 ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( "/" )
@@ -1304,7 +1304,7 @@ public class GatewayBasicFuncTest {
     .statusCode( HttpStatus.SC_OK )
     .contentType( "application/x-protobuf" )
     .content( is( driver.getResourceString( resourceName + ".protobuf", UTF8 ) ) )
-    .when().get( driver.getUrl( "STARGATE" ) );
+    .when().get( driver.getUrl( "WEBHBASE" ) );
     driver.assertComplete();
   }
 
@@ -1315,7 +1315,7 @@ public class GatewayBasicFuncTest {
     String resourceName = "hbase/table-schema";
     String path = "/table/schema";
 
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( path )
@@ -1323,18 +1323,18 @@ public class GatewayBasicFuncTest {
     .status( HttpStatus.SC_CREATED )
     .content( driver.getResourceBytes( resourceName + ".xml" ) )
     .contentType( ContentType.XML.toString() )
-    .header( "Location", driver.getRealUrl( "STARGATE" ) + path  );
+    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path  );
 
     given()
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_CREATED )
     .contentType( ContentType.XML )
-    .header( "Location", startsWith( driver.getUrl( "STARGATE" ) + path ) )
-    .when().put( driver.getUrl( "STARGATE" ) + path );
+    .header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + path ) )
+    .when().put( driver.getUrl( "WEBHBASE" ) + path );
     driver.assertComplete();
 
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( path )
@@ -1342,18 +1342,18 @@ public class GatewayBasicFuncTest {
     .status( HttpStatus.SC_CREATED )
     .content( driver.getResourceBytes( resourceName + ".json" ) )
     .contentType( ContentType.JSON.toString() )
-    .header( "Location", driver.getRealUrl( "STARGATE" ) + path  );
+    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path  );
     
     given()
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_CREATED )
     .contentType( ContentType.JSON )
-    .header( "Location", startsWith( driver.getUrl( "STARGATE" ) + path ) )
-    .when().put( driver.getUrl( "STARGATE" ) + path );
+    .header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + path ) )
+    .when().put( driver.getUrl( "WEBHBASE" ) + path );
     driver.assertComplete();
 
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( path )
@@ -1361,15 +1361,15 @@ public class GatewayBasicFuncTest {
     .status( HttpStatus.SC_CREATED )
     .content( driver.getResourceBytes( resourceName + ".protobuf" ) )
     .contentType( "application/x-protobuf" )
-    .header( "Location", driver.getRealUrl( "STARGATE" ) + path  );
+    .header( "Location", driver.getRealUrl( "WEBHBASE" ) + path  );
 
     given()
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_CREATED )
     .contentType( "application/x-protobuf" )
-    .header( "Location", startsWith( driver.getUrl( "STARGATE" ) + path ) )
-    .when().put( driver.getUrl( "STARGATE" ) + path );
+    .header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + path ) )
+    .when().put( driver.getUrl( "WEBHBASE" ) + path );
     driver.assertComplete();
 
   }
@@ -1381,7 +1381,7 @@ public class GatewayBasicFuncTest {
     String resourceName = "hbase/table-metadata";
     String path = "/table/schema";
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( path )
@@ -1397,7 +1397,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.XML )
-    .when().get( driver.getUrl( "STARGATE" ) + path );
+    .when().get( driver.getUrl( "WEBHBASE" ) + path );
 
     MatcherAssert
         .assertThat(
@@ -1405,7 +1405,7 @@ public class GatewayBasicFuncTest {
             isEquivalentTo( the( driver.getResourceString( resourceName + ".xml", UTF8 ) ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( path )
@@ -1421,13 +1421,13 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.JSON )
-    .when().get( driver.getUrl( "STARGATE" ) + path );
+    .when().get( driver.getUrl( "WEBHBASE" ) + path );
     
     MatcherAssert
     .assertThat( response.getBody().asString(), sameJSONAs( driver.getResourceString( resourceName + ".json", UTF8 ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( path )
@@ -1444,7 +1444,7 @@ public class GatewayBasicFuncTest {
     .statusCode( HttpStatus.SC_OK )
     //.content( is( driver.getResourceBytes( resourceName + ".protobuf" ) ) )
     .contentType( "application/x-protobuf" )
-    .when().get( driver.getUrl( "STARGATE" ) + path );
+    .when().get( driver.getUrl( "WEBHBASE" ) + path );
     // RestAssured seems to be screwing up the binary comparison so do it explicitly.
     assertThat( driver.getResourceBytes( resourceName + ".protobuf" ), is( response.body().asByteArray() ) );
     driver.assertComplete();
@@ -1461,7 +1461,7 @@ public class GatewayBasicFuncTest {
     
     //PUT request
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( multipleRowPath )
@@ -1478,10 +1478,10 @@ public class GatewayBasicFuncTest {
     .contentType( ContentType.XML.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().put( driver.getUrl( "STARGATE" ) + multipleRowPath );
+    .when().put( driver.getUrl( "WEBHBASE" ) + multipleRowPath );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( singleRowPath )
@@ -1497,10 +1497,10 @@ public class GatewayBasicFuncTest {
     .contentType( ContentType.JSON.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().put( driver.getUrl( "STARGATE" ) + singleRowPath );
+    .when().put( driver.getUrl( "WEBHBASE" ) + singleRowPath );
     driver.assertComplete();
  
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( multipleRowPath )
@@ -1517,12 +1517,12 @@ public class GatewayBasicFuncTest {
     .contentType( "application/x-protobuf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().put( driver.getUrl( "STARGATE" ) + multipleRowPath );
+    .when().put( driver.getUrl( "WEBHBASE" ) + multipleRowPath );
     driver.assertComplete();
     
     //POST request
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "POST" )
     .pathInfo( multipleRowPath )
@@ -1539,10 +1539,10 @@ public class GatewayBasicFuncTest {
       .contentType( ContentType.XML.toString() )
       .expect()
       .statusCode( HttpStatus.SC_OK )
-      .when().post( driver.getUrl( "STARGATE" ) + multipleRowPath );
+      .when().post( driver.getUrl( "WEBHBASE" ) + multipleRowPath );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "POST" )
     .pathInfo( singleRowPath )
@@ -1558,10 +1558,10 @@ public class GatewayBasicFuncTest {
     .contentType( ContentType.JSON.toString() )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().post( driver.getUrl( "STARGATE" ) + singleRowPath );
+    .when().post( driver.getUrl( "WEBHBASE" ) + singleRowPath );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "POST" )
     .pathInfo( multipleRowPath )
@@ -1578,7 +1578,7 @@ public class GatewayBasicFuncTest {
     .contentType( "application/x-protobuf" )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().post( driver.getUrl( "STARGATE" ) + multipleRowPath );
+    .when().post( driver.getUrl( "WEBHBASE" ) + multipleRowPath );
     driver.assertComplete();
   }
 
@@ -1592,7 +1592,7 @@ public class GatewayBasicFuncTest {
     String familyId = "family";
     String columnId = "column";
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId )
@@ -1603,10 +1603,10 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().delete( driver.getUrl( "STARGATE" ) + "/" + tableId + "/" + rowId );
+    .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId + "/" + familyId )
@@ -1617,10 +1617,10 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().delete( driver.getUrl( "STARGATE" ) + "/" + tableId + "/" + rowId + "/" + familyId );
+    .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId + "/" + familyId );
     driver.assertComplete();
 
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "DELETE" )
     .pathInfo( "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId )
@@ -1631,7 +1631,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().delete( driver.getUrl( "STARGATE" ) + "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId );
+    .when().delete( driver.getUrl( "WEBHBASE" ) + "/" + tableId + "/" + rowId + "/" + familyId + ":" + columnId );
     driver.assertComplete();
 
   }
@@ -1648,7 +1648,7 @@ public class GatewayBasicFuncTest {
     String rowsWithKeyPath = "/table/row";
     String rowsWithKeyAndColumnPath = "/table/row/family:col";
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( allRowsPath )
@@ -1664,7 +1664,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.XML )
-    .when().get( driver.getUrl( "STARGATE" ) + allRowsPath );
+    .when().get( driver.getUrl( "WEBHBASE" ) + allRowsPath );
     
     MatcherAssert
     .assertThat(
@@ -1672,7 +1672,7 @@ public class GatewayBasicFuncTest {
         isEquivalentTo( the( driver.getResourceString( resourceName + ".xml", UTF8 ) ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( rowsStartsWithPath )
@@ -1688,7 +1688,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.XML )
-    .when().get( driver.getUrl( "STARGATE" ) + rowsStartsWithPath );
+    .when().get( driver.getUrl( "WEBHBASE" ) + rowsStartsWithPath );
     
     MatcherAssert
     .assertThat(
@@ -1696,7 +1696,7 @@ public class GatewayBasicFuncTest {
         isEquivalentTo( the( driver.getResourceString( resourceName + ".xml", UTF8 ) ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( rowsWithKeyPath )
@@ -1712,13 +1712,13 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.JSON )
-    .when().get( driver.getUrl( "STARGATE" ) + rowsWithKeyPath );
+    .when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyPath );
     
     MatcherAssert
     .assertThat( response.getBody().asString(), sameJSONAs( driver.getResourceString( resourceName + ".json", UTF8 ) ) );
     driver.assertComplete();
     
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( rowsWithKeyAndColumnPath )
@@ -1734,7 +1734,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.JSON )
-    .when().get( driver.getUrl( "STARGATE" ) + rowsWithKeyAndColumnPath );
+    .when().get( driver.getUrl( "WEBHBASE" ) + rowsWithKeyAndColumnPath );
     
     MatcherAssert
     .assertThat( response.getBody().asString(), sameJSONAs( driver.getResourceString( resourceName + ".json", UTF8 ) ) );
@@ -1752,7 +1752,7 @@ public class GatewayBasicFuncTest {
     String scannerId = "13705290446328cff5ed";
     
     //Create scanner for table using PUT and POST requests
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "PUT" )
     .pathInfo( scannerPath )
@@ -1766,13 +1766,13 @@ public class GatewayBasicFuncTest {
     .content( driver.getResourceBytes( scannerDefinitionResourceName + ".xml" ) )
     .expect()
     //TODO: Add "Location" header check  when issue with incorrect outbound rewrites will be resolved
-    //.header( "Location", startsWith( driver.getUrl( "STARGATE" ) + createScannerPath ) )
+    //.header( "Location", startsWith( driver.getUrl( "WEBHBASE" ) + createScannerPath ) )
     .statusCode( HttpStatus.SC_CREATED )
-    .when().put( driver.getUrl( "STARGATE" ) + scannerPath );
+    .when().put( driver.getUrl( "WEBHBASE" ) + scannerPath );
     driver.assertComplete();
     
     //Get the values of the next cells found by the scanner 
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "GET" )
     .pathInfo( scannerPath + "/" + scannerId )
@@ -1788,7 +1788,7 @@ public class GatewayBasicFuncTest {
     .expect()
     .statusCode( HttpStatus.SC_OK )
     .contentType( ContentType.XML )
-    .when().get( driver.getUrl( "STARGATE" ) + scannerPath + "/" + scannerId );
+    .when().get( driver.getUrl( "WEBHBASE" ) + scannerPath + "/" + scannerId );
     
     MatcherAssert
     .assertThat(
@@ -1797,7 +1797,7 @@ public class GatewayBasicFuncTest {
     driver.assertComplete();
     
     //Delete scanner
-    driver.getMock( "STARGATE" )
+    driver.getMock( "WEBHBASE" )
     .expect()
     .method( "DELETE" )
     .pathInfo( scannerPath + "/" + scannerId )
@@ -1808,7 +1808,7 @@ public class GatewayBasicFuncTest {
     .auth().preemptive().basic( username, password )
     .expect()
     .statusCode( HttpStatus.SC_OK )
-    .when().delete( driver.getUrl( "STARGATE" ) + scannerPath + "/" + scannerId );
+    .when().delete( driver.getUrl( "WEBHBASE" ) + scannerPath + "/" + scannerId );
     driver.assertComplete();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/hsso-release/home/deployments/sample.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/deployments/sample.xml b/hsso-release/home/deployments/sample.xml
index 3b15ae4..645a6e3 100644
--- a/hsso-release/home/deployments/sample.xml
+++ b/hsso-release/home/deployments/sample.xml
@@ -43,7 +43,7 @@
         <url>http://localhost:11000/oozie</url>
     </service>
     <service>
-        <role>STARGATE</role>
+        <role>WEBHBASE</role>
         <url>http://localhost:60080</url>
     </service>
     <service>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/7756104b/hsso-release/home/templates/topology.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/templates/topology.xml b/hsso-release/home/templates/topology.xml
index 15cc546..8ee236e 100644
--- a/hsso-release/home/templates/topology.xml
+++ b/hsso-release/home/templates/topology.xml
@@ -63,7 +63,7 @@
         <url>http://localhost:11000/oozie</url>
     </service>
     <service>
-        <role>STARGATE</role>
+        <role>WEBHBASE</role>
         <url>http://localhost:60080</url>
     </service>
     <service>


[3/8] git commit: KNOX-42: Changed datanode URLs.

Posted by km...@apache.org.
KNOX-42: Changed datanode URLs.


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

Branch: refs/heads/master
Commit: 87012696d89cdf9b6794ce82a6629f6f06ff3745
Parents: c44e010
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Mon Sep 23 16:56:54 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:15 2013 -0400

----------------------------------------------------------------------
 build.xml                                       |  3 +-
 .../gateway/filter/rewrite/impl/rewrite.xml     |  8 ++--
 .../home/samples/SampleService.groovy           |  2 +-
 .../hdfs/WebHdfsDeploymentContributor.java      | 43 +-------------------
 .../WebHdfsDeploymentContributor/rewrite.xml    |  4 +-
 .../hadoop/gateway/GatewayBasicFuncTest.java    |  2 +-
 .../gateway/util/urltemplate/MatcherTest.java   |  2 +-
 .../gateway/util/urltemplate/ParserTest.java    |  8 ++--
 .../gateway/util/urltemplate/RewriterTest.java  | 12 +++---
 9 files changed, 22 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 65415bd..fcc1ec4 100644
--- a/build.xml
+++ b/build.xml
@@ -58,7 +58,8 @@
     </target>
 
     <target name="clean" depends="init" description="Clean up any build artifacts.">
-        <delete file="target/${gateway-version}"/>
+        <delete file="target"/>
+        <delete file="install"/>
     </target>
 
     <target name="build" depends="init" description="Build the product.">

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/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 7196f87..b10fe0a 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
@@ -83,17 +83,17 @@
     <rule dir="IN" name="WEBHDFS/webhdfs/namenode/file/inbound" pattern="*://*:*/**/namenode/api/{version}/{path=**}?{**}">
         <rewrite template="http://vm:50070/webhdfs/{version}/{path=**}?{**}"/>
     </rule>
-    <rule dir="IN" name="WEBHDFS/webhdfs/datanode/inbound" pattern="*://*:*/**/datanode/api/{version}/{path=**}?**">
+    <rule dir="IN" name="WEBHDFS/webhdfs/datanode/inbound" pattern="*://*:*/**/webhdfs/data/{version}/{path=**}?**">
         <decode-query/>
-        <match pattern="*://*:*/**/datanode/api/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
+        <match pattern="*://*:*/**/webhdfs/data/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
         <rewrite template="http://{host}:{port}/{path=**}?{**}"/>
     </rule>
     <rule dir="OUT" name="WEBHDFS/webhdfs/datanode/outbound" pattern="*://*:*/**?**">
         <match pattern="*://{host}:{port}/{path=**}?{**}"/>
-        <rewrite template="{gateway.url}/datanode/api/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
+        <rewrite template="{gateway.url}/webhdfs/data/{version}/{path=**}?{host}&amp;{port}&amp;{**}"/>
         <encode-query/>
     </rule>
-    <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/webhdfs/api/{path=**}?{**}">
+    <rule dir="IN" name="WEBHCAT/webhcat/request" pattern="*://*:*/**/webhcat/api/{path=**}?{**}">
         <rewrite template="http://vm:50111/templeton/{path=**}?{**}"/>
     </rule>
     <rule dir="IN" name="OOZIE/oozie/root/inbound" pattern="*://*:*/**/oozie/api/{**}?{**}">

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/gateway-release/home/samples/SampleService.groovy
----------------------------------------------------------------------
diff --git a/gateway-release/home/samples/SampleService.groovy b/gateway-release/home/samples/SampleService.groovy
index 10ca4be..e8c5bdf 100644
--- a/gateway-release/home/samples/SampleService.groovy
+++ b/gateway-release/home/samples/SampleService.groovy
@@ -19,7 +19,7 @@ import org.apache.hadoop.gateway.shell.Hadoop
 
 class SampleService {
 
-  static String PATH = "/webhdfs/api/v1"
+  static String PATH = "/namenode/api/v1"
 
   static SampleSimpleCommand simple( Hadoop hadoop ) {
     return new SampleSimpleCommand( hadoop )

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/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
index f39912d..b7f0ec5 100644
--- 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
@@ -38,7 +38,7 @@ public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBa
 
   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 DATANODE_EXTERNAL_PATH = "/webhdfs/data/v1";
 //  private static final String WEBHDFS_INTERNAL_PATH = "/webhdfs";
 //  private static final String CLUSTER_URL_FUNCTION = "{gateway.url}";
 
@@ -63,47 +63,6 @@ public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBa
     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 {

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/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
index d0bd2e2..0c746b6 100644
--- 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
@@ -27,7 +27,7 @@
 
     <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}?{**}"/>
+        <rewrite template="{gateway.url}/webhdfs/data/v1/{path=**}?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
         <encrypt-query/>
     </rule>
 
@@ -49,7 +49,7 @@
 
     <rule dir="IN" name="WEBHDFS/webhdfs/inbound/datanode">
         <decrypt-query/>
-        <match pattern="*://*:*/**/datanode/api/*/{path=**}?{scheme}?{host}?{port}?{**}"/>
+        <match pattern="*://*:*/**/webhdfs/data/*/{path=**}?{scheme}?{host}?{port}?{**}"/>
         <rewrite template="{scheme}://{host}:{port}/{path=**}?{**}"/>
     </rule>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/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 a1de86a..b03b6cb 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
@@ -118,7 +118,7 @@ public class GatewayBasicFuncTest {
     driver.setResourceBase( GatewayBasicFuncTest.class );
     driver.setupLdap( findFreePort() );
     driver.setupService( "WEBHDFS", "http://" + TEST_HOST + ":50070/webhdfs", "/cluster/namenode/api", USE_MOCK_SERVICES );
-    driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/datanode/api", USE_MOCK_SERVICES );
+    driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/webhdfs/data", 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 );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
index 0382326..912c4ea 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
@@ -639,7 +639,7 @@ public class MatcherTest {
     stringMatcher = new Matcher<String>();
     template = Parser.parse( "*://*:*/**/namenode/api/v1/{path=**}?{**=*}" );
     stringMatcher.add( template, "test-value-B" );
-    template = Parser.parse( "*://*:*/**/datanode/api/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
+    template = Parser.parse( "*://*:*/**/webhdfs/data/v1/{path=**}?host={host=*}&port={port=*}&{**=*}" );
     stringMatcher.add( template, "test-value-C" );
     input = Parser.parse( "http://localhost:53221/gateway/cluster/namenode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir?user.name=hdfs&op=MKDIRS" );
     match = stringMatcher.match( input );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
index 221b67c..69fdf5b 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/ParserTest.java
@@ -910,17 +910,17 @@ public class ParserTest {
     string = expander.expandToString( template, null, null );
     assertThat( string, is( "*://*:*/**?X" ) );
 
-    template = Parser.parse( "http://localhost:62142/gateway/cluster/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" );
+    template = Parser.parse( "http://localhost:62142/gateway/cluster/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" );
     assertThat( template, notNullValue() );
     assertThat( template.getQuery().get( "aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ), notNullValue() );
     string = expander.expandToString( template, null, null );
-    assertThat( string, is( "http://localhost:62142/gateway/cluster/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ) );
+    assertThat( string, is( "http://localhost:62142/gateway/cluster/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ) );
 
-    template = Parser.parse( "http://localhost:62142/gateway/cluster/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM=" );
+    template = Parser.parse( "http://localhost:62142/gateway/cluster/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM=" );
     assertThat( template, notNullValue() );
     assertThat( template.getQuery().get( "aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ), notNullValue() );
     string = expander.expandToString( template, null, null );
-    assertThat( string, is( "http://localhost:62142/gateway/cluster/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ) );
+    assertThat( string, is( "http://localhost:62142/gateway/cluster/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/testBasicHdfsUseCase/dir/file?aG9zdD1sb2NhbGhvc3QmcG9ydD02MjEzOSZvcD1DUkVBVEUmdXNlci5uYW1lPWhkZnM" ) );
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/87012696/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
----------------------------------------------------------------------
diff --git a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
index 1e9b441..58e7f1c 100644
--- a/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
+++ b/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/RewriterTest.java
@@ -242,9 +242,9 @@ public class RewriterTest {
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     assertThat( actualOutput, equalTo( expectOutput ) );
 
-    actualInput = new URI( "/datanode/api/v1/test?user.name=hdfs&op=CREATE&overwrite=false&host=vm.home&port=50075" );
+    actualInput = new URI( "/webhdfs/data/v1/test?user.name=hdfs&op=CREATE&overwrite=false&host=vm.home&port=50075" );
     expectOutput = new URI( "http://vm.home:50075/webhdfs/v1/test?op=CREATE&user.name=hdfs&overwrite=false" );
-    sourcePattern = Parser.parse( "/datanode/api/v1/{path=**}?{host}&{port}&{**}" );
+    sourcePattern = Parser.parse( "/webhdfs/data/v1/{path=**}?{host}&{port}&{**}" );
     targetPattern = Parser.parse( "http://{host}:{port}/webhdfs/v1/{path=**}?{**}" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     // Note: Had to change the order of the expected query params to match.
@@ -282,10 +282,10 @@ public class RewriterTest {
     URI actualInput, actualOutput, expectOutput;
 
     sourcePattern = Parser.parse( "*://{host}:{port}/webhdfs/v1/{path=**}?{**}" );
-    targetPattern = Parser.parse( "{gateway.url}/datanode/api/v1/{path=**}?{host}&{port}&{**}" );
+    targetPattern = Parser.parse( "{gateway.url}/webhdfs/data/v1/{path=**}?{host}&{port}&{**}" );
 
     actualInput = new URI( "http://vm.local:50075/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
-    expectOutput = new URI( "http://gw:8888/gateway/cluster/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?host=vm.local&port=50075&op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
+    expectOutput = new URI( "http://gw:8888/gateway/cluster/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?host=vm.local&port=50075&op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     assertThat( actualOutput, equalTo( expectOutput ) );
   }
@@ -302,10 +302,10 @@ public class RewriterTest {
     Template sourcePattern, targetPattern;
     URI actualInput, actualOutput, expectOutput;
 
-    sourcePattern = Parser.parse( "/datanode/api/v1/{path=**}?{host}&{port}&{**}" );
+    sourcePattern = Parser.parse( "/webhdfs/data/v1/{path=**}?{host}&{port}&{**}" );
     targetPattern = Parser.parse( "http://{host}:{port}/webhdfs/v1/{path=**}?{**}" );
 
-    actualInput = new URI( "/datanode/api/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?host=vm.local&port=50075&op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
+    actualInput = new URI( "/webhdfs/data/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?host=vm.local&port=50075&op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
     expectOutput = new URI( "http://vm.local:50075/webhdfs/v1/tmp/GatewayWebHdfsFuncTest/dirA700/fileA700?op=CREATE&user.name=hdfs&overwrite=false&permission=700" );
     actualOutput = Rewriter.rewrite( actualInput, sourcePattern, targetPattern, new TestResolver( config, request ), null );
     assertThat( actualOutput, equalTo( expectOutput ) );


[4/8] git commit: KNOX-152 - Dynamic redeploy of topo causes subsequent requests to fail

Posted by km...@apache.org.
KNOX-152 - Dynamic redeploy of topo causes subsequent requests to fail


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

Branch: refs/heads/master
Commit: 209d23bcd977a68c6518cdcd26d8a544e83fb4e1
Parents: 7756104
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 24 11:43:43 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 24 11:44:16 2013 -0400

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/gateway/GatewayServer.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/209d23bc/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
index 827ab88..e2f4f36 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/GatewayServer.java
@@ -302,7 +302,7 @@ public class GatewayServer {
     context.setDefaultsDescriptor( null );
     context.setContextPath( "/" + config.getGatewayPath() + "/" + name );
     context.setWar( warPath );
-    internalUndeploy( topology );
+    // internalUndeploy( topology ); KNOX-152
     context.setAttribute( GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE, name );
     deployments.put( name, context );
     contexts.addHandler( context );
@@ -352,6 +352,7 @@ public class GatewayServer {
             try {
               if( !warDir.exists() ) {
                 log.deployingTopology( topology.getName(), warDir.getAbsolutePath() );
+                internalUndeploy( topology ); // KNOX-152
                 WebArchive war = null;
                 war = DeploymentFactory.createDeployment( config, topology );
                 File tmp = war.as( ExplodedExporter.class ).exportExploded( topoDir, warDir.getName() + ".tmp" );