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/17 15:45:39 UTC

git commit: KNOX-42: Move v1 from WebHCat/Templeton URL matching rules to rewrite rules.

Updated Branches:
  refs/heads/master 36034a692 -> a90743be7


KNOX-42: Move v1 from WebHCat/Templeton URL matching rules to rewrite rules.


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

Branch: refs/heads/master
Commit: a90743be7fab4013709244912194c4660fb8d81c
Parents: 36034a6
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Tue Sep 17 09:45:34 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Tue Sep 17 09:45:34 2013 -0400

----------------------------------------------------------------------
 gateway-release/home/INSTALL                        | 10 +++++-----
 gateway-release/home/deployments/sample.xml         |  2 +-
 gateway-release/home/templates/sample.conf          |  2 +-
 gateway-release/home/templates/sample.xml           |  2 +-
 .../org/apache/hadoop/gateway/GatewayServer.xml     |  4 ++--
 .../org/apache/hadoop/gateway/GatewayFuncTest.xml   |  1 -
 .../topology/xml/TopologyRulesModuleTest.java       |  2 +-
 .../org/apache/hadoop/gateway/GatewayFuncTest.xml   |  2 +-
 .../topology/xml/simple-topology-ambari-format.conf |  2 +-
 .../templeton/TempletonDeploymentContributor.java   |  5 +++--
 .../apache/hadoop/gateway/GatewayBasicFuncTest.java |  2 +-
 .../hadoop/gateway/GatewayFuncTestDriver.java       | 16 ++++++++--------
 hsso-release/home/INSTALL                           | 14 +++++++-------
 hsso-release/home/deployments/sample.xml            |  2 +-
 hsso-release/home/templates/topology.xml            |  2 +-
 15 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-release/home/INSTALL
----------------------------------------------------------------------
diff --git a/gateway-release/home/INSTALL b/gateway-release/home/INSTALL
index d972b2e..95c095b 100644
--- a/gateway-release/home/INSTALL
+++ b/gateway-release/home/INSTALL
@@ -211,15 +211,15 @@ of the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml)
 and the cluster topology descriptors
 (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-  HDFS (NameNode)
+  WebHDFS
     Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/namenode/api
     Cluster: http://<namenode-host>:50070/webhdfs
   WebHCat (Templeton)
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api/v1
-    Cluster: http://<templeton-host>:50111/templeton/v1
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api
+    Cluster: http://<templeton-host>:50111/templeton
   Oozie
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api/v1
-    Cluster: http://<templeton-host>:11000/oozie/v1
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api
+    Cluster: http://<templeton-host>:11000/oozie
 
 The values for <gateway-host>, <gateway-port>, <gateway-path> are provided via
 the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml).

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-release/home/deployments/sample.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/deployments/sample.xml b/gateway-release/home/deployments/sample.xml
index 54723a2..bb0c1e7 100644
--- a/gateway-release/home/deployments/sample.xml
+++ b/gateway-release/home/deployments/sample.xml
@@ -70,7 +70,7 @@
     </service>
     <service>
         <role>TEMPLETON</role>
-        <url>http://localhost:50111/templeton/v1</url>
+        <url>http://localhost:50111/templeton</url>
     </service>
     <service>
         <role>OOZIE</role>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-release/home/templates/sample.conf
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.conf b/gateway-release/home/templates/sample.conf
index e495270..63f707c 100644
--- a/gateway-release/home/templates/sample.conf
+++ b/gateway-release/home/templates/sample.conf
@@ -62,7 +62,7 @@
     </property>
     <property>
         <name>topology.service.TEMPLETON..url</name>
-        <value>http://localhost:50111/templeton/v1</value>
+        <value>http://localhost:50111/templeton</value>
     </property>
     <property>
         <name>topology.service.OOZIE..url</name>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-release/home/templates/sample.xml
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/sample.xml b/gateway-release/home/templates/sample.xml
index 0d1292e..960ecdf 100644
--- a/gateway-release/home/templates/sample.xml
+++ b/gateway-release/home/templates/sample.xml
@@ -56,7 +56,7 @@
     </service>
     <service>
         <role>TEMPLETON</role>
-        <url>http://localhost:50111/templeton/v1</url>
+        <url>http://localhost:50111/templeton</url>
     </service>
     <service>
         <role>OOZIE</role>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/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 3447f05..b4023d8 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
@@ -53,8 +53,8 @@
 
     <service>
         <name>templeton</name>
-        <source>/templeton/api/v1/{path=**}?{**}</source>
-        <target>http://{templeton.address}/templeton/v1/{path=**}?{**}</target>
+        <source>/templeton/api/{path=**}?{**}</source>
+        <target>http://{templeton.address}/templeton/{path=**}?{**}</target>
         <filter>
             <name>shiro</name>
             <class>org.apache.shiro.web.servlet.ShiroFilter</class>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/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 e11003f..1e075ed 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
@@ -54,7 +54,6 @@
     <service>
         <name>templeton</name>
         <source>/templeton/api/v1/{path=**}?{**}</source>
-        <target>http://{templeton.address}/templeton/v1/{path=**}?{**}</target>
         <filter>
             <name>shiro</name>
             <class>org.apache.shiro.web.servlet.ShiroFilter</class>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
index 3b9b53b..a5e9d32 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/topology/xml/TopologyRulesModuleTest.java
@@ -107,7 +107,7 @@ public class TopologyRulesModuleTest {
     assertThat( templetonService, notNullValue() );
     assertThat( templetonService.getRole(), is( "TEMPLETON" ) );
     assertThat( templetonService.getName(), nullValue() );
-    assertThat( templetonService.getUrl(), is( "http://host:50111/templeton/v1" ) );
+    assertThat( templetonService.getUrl(), is( "http://host:50111/templeton" ) );
 
     Service oozieService = topology.getService( "OOZIE", null );
     assertThat( oozieService, notNullValue() );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/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 1c6cb25..56785e9 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
@@ -55,7 +55,7 @@
     <resource>
         <!--<name>templeton</name>-->
         <source>/templeton/api/v1/{path=**}?{**}</source>
-        <target>http://{templeton.address}/templeton/v1/{path=**}?{**}</target>
+        <target>http://{templeton.address}/templeton/{path=**}?{**}</target>
         <filter>
             <role>authentication</role>
             <class>org.apache.shiro.web.servlet.ShiroFilter</class>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf b/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
index 394b3c0..8197013 100644
--- a/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
+++ b/gateway-server/src/test/resources/org/apache/hadoop/gateway/topology/xml/simple-topology-ambari-format.conf
@@ -62,7 +62,7 @@
     </property>
     <property>
         <name>topology.service.TEMPLETON..url</name>
-        <value>http://host:50111/templeton/v1</value>
+        <value>http://host:50111/templeton</value>
     </property>
     <property>
         <name>topology.service.OOZIE..url</name>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java b/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
index 406867e..d0f97c1 100644
--- a/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
+++ b/gateway-service-templeton/src/main/java/org/apache/hadoop/gateway/templeton/TempletonDeploymentContributor.java
@@ -27,7 +27,8 @@ import org.apache.hadoop.gateway.topology.Service;
 
 import java.net.URISyntaxException;
 
-public class TempletonDeploymentContributor extends ServiceDeploymentContributorBase {
+public class
+    TempletonDeploymentContributor extends ServiceDeploymentContributorBase {
 
   private static final String TEMPLETON_EXTERNAL_PATH = "/templeton/api/v1";
 
@@ -51,7 +52,7 @@ public class TempletonDeploymentContributor extends ServiceDeploymentContributor
         .directions( "request" )
         .pattern( "*://*:*/**" + TEMPLETON_EXTERNAL_PATH + "/{path=**}?{**}" );
     rewrite = rule.addStep( "rewrite" );
-    rewrite.template( service.getUrl() + "/{path=**}?{**}" );
+    rewrite.template( service.getUrl() + "/v1/{path=**}?{**}" );
 
     ResourceDescriptor resource = context.getGatewayDescriptor().addResource();
     resource.role( service.getRole() );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/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 c1f18ef..135a0b4 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayBasicFuncTest.java
@@ -121,7 +121,7 @@ public class GatewayBasicFuncTest {
     driver.setupService( "NAMENODE", "hdfs://" + TEST_HOST + ":8020", null, USE_MOCK_SERVICES );
     driver.setupService( "DATANODE", "http://" + TEST_HOST + ":50075/webhdfs", "/cluster/datanode/api", USE_MOCK_SERVICES );
     driver.setupService( "JOBTRACKER", "thrift://" + TEST_HOST + ":8021", null, USE_MOCK_SERVICES );
-    driver.setupService( "TEMPLETON", "http://" + TEST_HOST + ":50111/templeton/v1", "/cluster/templeton/api/v1", USE_MOCK_SERVICES );
+    driver.setupService( "TEMPLETON", "http://" + TEST_HOST + ":50111/templeton", "/cluster/templeton/api", USE_MOCK_SERVICES );
     driver.setupService( "OOZIE", "http://" + TEST_HOST + ":11000/oozie", "/cluster/oozie/api", USE_MOCK_SERVICES );
     driver.setupService( "HIVE", "http://" + TEST_HOST + ":10000", "/cluster/hive/api/v1", USE_MOCK_SERVICES );
     driver.setupService( "STARGATE", "http://" + TEST_HOST + ":2707", "/cluster/hbase/api/v1", USE_MOCK_SERVICES );

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
----------------------------------------------------------------------
diff --git a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
index eafaf60..9c05b56 100644
--- a/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
+++ b/gateway-test/src/test/java/org/apache/hadoop/gateway/GatewayFuncTestDriver.java
@@ -618,7 +618,7 @@ public class GatewayFuncTestDriver {
     getMock( "TEMPLETON" )
         .expect()
         .method( "POST" )
-        .pathInfo( "/mapreduce/jar" )
+        .pathInfo( "/v1/mapreduce/jar" )
         .formParam( "user.name", user )
         .formParam( "jar", jar )
         .formParam( "class", main )
@@ -637,7 +637,7 @@ public class GatewayFuncTestDriver {
         .expect()
         //.log().all()
         .statusCode( status )
-        .when().post( getUrl( "TEMPLETON" ) + "/mapreduce/jar" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
+        .when().post( getUrl( "TEMPLETON" ) + "/v1/mapreduce/jar" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
     log.debug( "JOB=" + job );
@@ -649,7 +649,7 @@ public class GatewayFuncTestDriver {
     getMock( "TEMPLETON" )
         .expect()
         .method( "POST" )
-        .pathInfo( "/pig" )
+        .pathInfo( "/v1/pig" )
         .respond()
         .status( status[0] )
         .contentType( "application/json" )
@@ -669,7 +669,7 @@ public class GatewayFuncTestDriver {
         .contentType( "application/json" )
         //.content( "boolean", equalTo( true ) )
         .when()
-        .post( getUrl( "TEMPLETON" ) + "/pig" + ( isUseGateway() ? "" : "?user.name=" + user ) )
+        .post( getUrl( "TEMPLETON" ) + "/v1/pig" + ( isUseGateway() ? "" : "?user.name=" + user ) )
         .asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
@@ -682,7 +682,7 @@ public class GatewayFuncTestDriver {
     getMock( "TEMPLETON" )
         .expect()
         .method( "POST" )
-        .pathInfo( "/hive" )
+        .pathInfo( "/v1/hive" )
         .respond()
         .status( status[ 0 ] )
         .contentType( "application/json" )
@@ -701,7 +701,7 @@ public class GatewayFuncTestDriver {
         .contentType( "application/json" )
         //.content( "boolean", equalTo( true ) )
         .when()
-        .post( getUrl( "TEMPLETON" ) + "/hive" + ( isUseGateway() ? "" : "?user.name=" + user ) )
+        .post( getUrl( "TEMPLETON" ) + "/v1/hive" + ( isUseGateway() ? "" : "?user.name=" + user ) )
         .asString();
     log.trace( "JSON=" + json );
     String job = from( json ).getString( "id" );
@@ -714,7 +714,7 @@ public class GatewayFuncTestDriver {
     getMock( "TEMPLETON" )
           .expect()
           .method( "GET" )
-          .pathInfo( "/queue/" + job )
+          .pathInfo( "/v1/queue/" + job )
           .respond()
           .status( HttpStatus.SC_OK )
           .content( getResourceBytes( "templeton-job-status.json" ) )
@@ -727,7 +727,7 @@ public class GatewayFuncTestDriver {
         //.log().all()
         .content( "status.jobId", equalTo( job ) )
         .statusCode( HttpStatus.SC_OK )
-        .when().get( getUrl( "TEMPLETON" ) + "/queue/{job}" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
+        .when().get( getUrl( "TEMPLETON" ) + "/v1/queue/{job}" + ( isUseGateway() ? "" : "?user.name=" + user ) ).asString();
     log.debug( "STATUS=" + status );
     assertComplete();
   }

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/hsso-release/home/INSTALL
----------------------------------------------------------------------
diff --git a/hsso-release/home/INSTALL b/hsso-release/home/INSTALL
index f198704..95c095b 100644
--- a/hsso-release/home/INSTALL
+++ b/hsso-release/home/INSTALL
@@ -211,15 +211,15 @@ of the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml)
 and the cluster topology descriptors
 (e.g. {GATEWAY_HOME}/deployments/<cluster-name>.xml).
 
-  HDFS (NameNode)
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/namenode/api/v1
-    Cluster: http://<namenode-host>:50070/webhdfs/v1
+  WebHDFS
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/namenode/api
+    Cluster: http://<namenode-host>:50070/webhdfs
   WebHCat (Templeton)
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api/v1
-    Cluster: http://<templeton-host>:50111/templeton/v1
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/templeton/api
+    Cluster: http://<templeton-host>:50111/templeton
   Oozie
-    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api/v1
-    Cluster: http://<templeton-host>:11000/oozie/v1
+    Gateway: http://<gateway-host>:<gateway-port>/<gateway-path>/<cluster-name>/oozie/api
+    Cluster: http://<templeton-host>:11000/oozie
 
 The values for <gateway-host>, <gateway-port>, <gateway-path> are provided via
 the Gateway configuration file (i.e. {GATEWAY_HOME}/gateway-site.xml).

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/hsso-release/home/deployments/sample.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/deployments/sample.xml b/hsso-release/home/deployments/sample.xml
index 6b86296..e399bec 100644
--- a/hsso-release/home/deployments/sample.xml
+++ b/hsso-release/home/deployments/sample.xml
@@ -36,7 +36,7 @@
     </service>
     <service>
         <role>TEMPLETON</role>
-        <url>http://localhost:50111/templeton/v1</url>
+        <url>http://localhost:50111/templeton</url>
     </service>
     <service>
         <role>OOZIE</role>

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/a90743be/hsso-release/home/templates/topology.xml
----------------------------------------------------------------------
diff --git a/hsso-release/home/templates/topology.xml b/hsso-release/home/templates/topology.xml
index d10a43b..5eb59f0 100644
--- a/hsso-release/home/templates/topology.xml
+++ b/hsso-release/home/templates/topology.xml
@@ -56,7 +56,7 @@
     </service>
     <service>
         <role>TEMPLETON</role>
-        <url>http://localhost:50111/templeton/v1</url>
+        <url>http://localhost:50111/templeton</url>
     </service>
     <service>
         <role>OOZIE</role>