knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject git commit: KNOX-421 optimize webhdfs file upload
Date Sat, 06 Sep 2014 15:04:32 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.5.0 ed78643e3 -> 372bad077


KNOX-421 optimize webhdfs file upload


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

Branch: refs/heads/v0.5.0
Commit: 372bad07774ae3c8250f80039e62e22e1c1ef232
Parents: ed78643
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Sat Sep 6 10:58:33 2014 -0400
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Sat Sep 6 11:03:31 2014 -0400

----------------------------------------------------------------------
 .../impl/DispatchDeploymentContributor.java     |  1 -
 .../WebHdfsDispatchDeploymentContributor.java   | 47 ------------
 .../hadoop/gateway/dispatch/HdfsDispatch.java   | 80 --------------------
 ...gateway.deploy.ProviderDeploymentContributor |  1 -
 ...NameNodeHaDispatchDeploymentContributor.java |  2 +-
 .../hdfs/WebHdfsDeploymentContributor.java      |  8 +-
 .../WebHdfsDispatchDeploymentContributor.java   | 47 ++++++++++++
 .../gateway/hdfs/dispatch/HdfsDispatch.java     | 45 +++++++++++
 .../dispatch/WebHdfsHaHttpClientDispatch.java   | 12 ++-
 ...gateway.deploy.ProviderDeploymentContributor |  3 +-
 .../deploy/DeploymentFactoryFuncTest.java       |  8 +-
 11 files changed, 112 insertions(+), 142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/DispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/DispatchDeploymentContributor.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/DispatchDeploymentContributor.java
index c9189fb..08b74c4 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/DispatchDeploymentContributor.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/DispatchDeploymentContributor.java
@@ -26,7 +26,6 @@ import org.apache.hadoop.gateway.dispatch.HttpClientDispatch;
 import org.apache.hadoop.gateway.topology.Provider;
 import org.apache.hadoop.gateway.topology.Service;
 
-import java.util.ArrayList;
 import java.util.List;
 
 public class DispatchDeploymentContributor extends ProviderDeploymentContributorBase {

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/WebHdfsDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/WebHdfsDispatchDeploymentContributor.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/WebHdfsDispatchDeploymentContributor.java
deleted file mode 100644
index eb2fd37..0000000
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/deploy/impl/WebHdfsDispatchDeploymentContributor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.gateway.deploy.impl;
-
-import org.apache.hadoop.gateway.deploy.DeploymentContext;
-import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributorBase;
-import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
-import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
-import org.apache.hadoop.gateway.dispatch.HdfsDispatch;
-import org.apache.hadoop.gateway.topology.Provider;
-import org.apache.hadoop.gateway.topology.Service;
-
-import java.util.List;
-
-public class WebHdfsDispatchDeploymentContributor extends ProviderDeploymentContributorBase
{
-
-  @Override
-  public String getRole() {
-    return "dispatch-hdfs";
-  }
-
-  @Override
-  public String getName() {
-    return "hdfs";
-  }
-
-  @Override
-  public void contributeFilter( DeploymentContext context, Provider provider, Service service,
ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    resource.addFilter().role( getRole() ).name( getName() ).impl( HdfsDispatch.class );
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HdfsDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HdfsDispatch.java
b/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HdfsDispatch.java
deleted file mode 100644
index 4deeffb..0000000
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/dispatch/HdfsDispatch.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.hadoop.gateway.dispatch;
-
-import org.apache.hadoop.gateway.audit.api.Action;
-import org.apache.hadoop.gateway.audit.api.ActionOutcome;
-import org.apache.hadoop.gateway.audit.api.AuditServiceFactory;
-import org.apache.hadoop.gateway.audit.api.Auditor;
-import org.apache.hadoop.gateway.audit.api.ResourceType;
-import org.apache.hadoop.gateway.audit.log4j.audit.AuditConstants;
-import org.apache.http.Header;
-import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.http.util.EntityUtils;
-import org.eclipse.jetty.http.HttpStatus;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-public class HdfsDispatch extends HttpClientDispatch {
-
-  private static Auditor auditor = AuditServiceFactory.getAuditService().getAuditor( AuditConstants.DEFAULT_AUDITOR_NAME,
-          AuditConstants.KNOX_SERVICE_NAME, AuditConstants.KNOX_COMPONENT_NAME );
-
-  public HdfsDispatch() throws ServletException {
-    super();
-  }
-
-  //@Override
-  public void doPut( HttpServletRequest request, HttpServletResponse response )
-      throws IOException, URISyntaxException {
-    HttpEntity entity = createRequestEntity( request );
-    URI requestUri = getDispatchUrl( request );
-    
-    auditor.audit( Action.DISPATCH, request.getRequestURI(), ResourceType.URI, ActionOutcome.UNAVAILABLE
);
-    if( "CREATE".equals( request.getParameter( "op" ) ) ) {
-      HttpPut clientRequest = new HttpPut( requestUri );
-      HttpClient client = new DefaultHttpClient();
-      HttpResponse clientResponse = client.execute( clientRequest );
-      EntityUtils.consume( clientResponse.getEntity() );
-      if( clientResponse.getStatusLine().getStatusCode() == HttpStatus.TEMPORARY_REDIRECT_307
) {
-        Header locationHeader = clientResponse.getFirstHeader( "Location" );
-        String location = locationHeader.getValue();
-        clientRequest = new HttpPut( location );
-        clientRequest.setEntity( entity );
-        executeRequest( clientRequest, request, response );
-      }
-    } else {
-      HttpPut clientRequest = new HttpPut( requestUri );
-      if( entity.getContentLength() > 0 ) {
-        clientRequest.setEntity( entity );
-      }
-      executeRequest( clientRequest, request, response );
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-server/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
b/gateway-server/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
index 4ac8cbf..5f1021c 100644
--- a/gateway-server/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
+++ b/gateway-server/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
@@ -18,4 +18,3 @@
 
 org.apache.hadoop.gateway.deploy.impl.GenericProviderDeploymentContributor
 org.apache.hadoop.gateway.deploy.impl.DispatchDeploymentContributor
-org.apache.hadoop.gateway.deploy.impl.WebHdfsDispatchDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeHaDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeHaDispatchDeploymentContributor.java
b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeHaDispatchDeploymentContributor.java
index d5db9a7..c7b3ff9 100644
--- a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeHaDispatchDeploymentContributor.java
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/NameNodeHaDispatchDeploymentContributor.java
@@ -33,7 +33,7 @@ public class NameNodeHaDispatchDeploymentContributor extends ProviderDeploymentC
 
    private static final String ROLE = "dispatch";
 
-   private static final String NAME = "ha-http-client";
+   private static final String NAME = "ha-hdfs";
 
    @Override
    public String getRole() {

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/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 cb44a88..4c66200 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
@@ -80,7 +80,7 @@ public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBa
     addRewriteFilter( context, service, rootResource, params );
     addIdentityAssertionFilter( context, service, rootResource );
     addAuthorizationFilter( context, service, rootResource );
-    String dispatchName = getDispatchName( context );
+    String dispatchName = getDispatchNameForNN( context );
     String dispatchRole = "dispatch";
     addDispatchFilter( context, service, rootResource, dispatchRole, dispatchName );
 
@@ -160,16 +160,16 @@ public class WebHdfsDeploymentContributor extends ServiceDeploymentContributorBa
    /**
     * Returns the name of the dispatch to use by checking to see if 'HA' is enabled.
     */
-   private String getDispatchName(DeploymentContext context) {
+   private String getDispatchNameForNN(DeploymentContext context) {
       Provider provider = getProviderByRole(context, "ha");
       if (provider != null && provider.isEnabled()) {
          Map<String, String> params = provider.getParams();
          if (params != null) {
             if (params.containsKey(getRole())) {
-               return "ha-http-client";
+               return "ha-hdfs";
             }
          }
       }
-      return "http-client";
+      return "hdfs";
    }
 }

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDispatchDeploymentContributor.java
b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDispatchDeploymentContributor.java
new file mode 100644
index 0000000..78353d1
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/WebHdfsDispatchDeploymentContributor.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.gateway.hdfs;
+
+import org.apache.hadoop.gateway.deploy.DeploymentContext;
+import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributorBase;
+import org.apache.hadoop.gateway.descriptor.FilterParamDescriptor;
+import org.apache.hadoop.gateway.descriptor.ResourceDescriptor;
+import org.apache.hadoop.gateway.hdfs.dispatch.HdfsDispatch;
+import org.apache.hadoop.gateway.topology.Provider;
+import org.apache.hadoop.gateway.topology.Service;
+
+import java.util.List;
+
+public class WebHdfsDispatchDeploymentContributor extends ProviderDeploymentContributorBase
{
+
+  @Override
+  public String getRole() {
+    return "dispatch";
+  }
+
+  @Override
+  public String getName() {
+    return "hdfs";
+  }
+
+  @Override
+  public void contributeFilter( DeploymentContext context, Provider provider, Service service,
ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
+    resource.addFilter().role( getRole() ).name( getName() ).impl( HdfsDispatch.class ).params(params);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsDispatch.java
b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsDispatch.java
new file mode 100644
index 0000000..2ccc41e
--- /dev/null
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/HdfsDispatch.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.gateway.hdfs.dispatch;
+
+import org.apache.hadoop.gateway.dispatch.HttpClientDispatch;
+import org.apache.http.HttpEntity;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+public class HdfsDispatch extends HttpClientDispatch {
+
+  public HdfsDispatch() throws ServletException {
+    super();
+  }
+
+  //@Override
+  /**
+   * This method ensures that the request InputStream is not acquired
+   * prior to a dispatch to a component such as a namenode that doesn't
+   * the request body. The side effect of this is that the client does
+   * not get a 100 continue from Knox which will trigger the client to
+   * send the entire payload before redirect to the target component
+   * like a datanode and have to send it again.
+   */
+  protected HttpEntity createRequestEntity(HttpServletRequest request)
+      throws IOException {
+    return null;
+  }  
+}

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaHttpClientDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaHttpClientDispatch.java
b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaHttpClientDispatch.java
index e97e8c9..c3c4916 100644
--- a/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaHttpClientDispatch.java
+++ b/gateway-service-webhdfs/src/main/java/org/apache/hadoop/gateway/hdfs/dispatch/WebHdfsHaHttpClientDispatch.java
@@ -17,7 +17,6 @@
  */
 package org.apache.hadoop.gateway.hdfs.dispatch;
 
-import org.apache.hadoop.gateway.dispatch.HttpClientDispatch;
 import org.apache.hadoop.gateway.filter.AbstractGatewayFilter;
 import org.apache.hadoop.gateway.ha.provider.HaProvider;
 import org.apache.hadoop.gateway.ha.provider.HaServiceConfig;
@@ -38,9 +37,9 @@ import java.io.IOException;
 import java.net.URI;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public class WebHdfsHaHttpClientDispatch extends HttpClientDispatch {
+public class WebHdfsHaHttpClientDispatch extends HdfsDispatch {
 
-   private static final String FAILOVER_COUNTER_ATTRIBUTE = "dispatch.ha.failover.counter";
+  private static final String FAILOVER_COUNTER_ATTRIBUTE = "dispatch.ha.failover.counter";
 
    private static final String RETRY_COUNTER_ATTRIBUTE = "dispatch.ha.retry.counter";
 
@@ -60,6 +59,13 @@ public class WebHdfsHaHttpClientDispatch extends HttpClientDispatch {
 
    private HaProvider haProvider;
 
+   /**
+   * @throws ServletException
+   */
+  public WebHdfsHaHttpClientDispatch() throws ServletException {
+    super();
+  }
+
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
       resourceRole = filterConfig.getInitParameter(RESOURCE_ROLE_ATTRIBUTE);

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
b/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
index 43a6b3f..6fde03f 100644
--- a/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
+++ b/gateway-service-webhdfs/src/main/resources/META-INF/services/org.apache.hadoop.gateway.deploy.ProviderDeploymentContributor
@@ -16,4 +16,5 @@
 # limitations under the License.
 ##########################################################################
 
-org.apache.hadoop.gateway.hdfs.NameNodeHaDispatchDeploymentContributor
\ No newline at end of file
+org.apache.hadoop.gateway.hdfs.NameNodeHaDispatchDeploymentContributor
+org.apache.hadoop.gateway.hdfs.WebHdfsDispatchDeploymentContributor

http://git-wip-us.apache.org/repos/asf/knox/blob/372bad07/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 a93eb33..dbfa48d 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
@@ -249,8 +249,8 @@ public class DeploymentFactoryFuncTest {
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.hadoop.gateway.filter.AclsAuthorizationFilter"
) ) );
 
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/role", equalTo( "dispatch"
) ) );
-    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[1]/filter[7]/name", equalTo( "hdfs"
) ) );
+    assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.hdfs.dispatch.HdfsDispatch"
) ) );
 
     assertThat( gateway, hasXPath( "/gateway/resource[2]/pattern", equalTo( "/webhdfs/v1/**?**"
) ) );
     //assertThat( gateway, hasXPath( "/gateway/resource[2]/target", equalTo( "http://localhost:50070/webhdfs/v1/{path=**}?{**}"
) ) );
@@ -275,8 +275,8 @@ public class DeploymentFactoryFuncTest {
     assertThat( gateway, hasXPath( "/gateway/resource[1]/filter[6]/class", equalTo( "org.apache.hadoop.gateway.filter.AclsAuthorizationFilter"
) ) );
 
     assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/role", equalTo( "dispatch"
) ) );
-    assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/name", equalTo( "http-client"
) ) );
-    assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.dispatch.HttpClientDispatch"
) ) );
+    assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/name", equalTo( "hdfs"
) ) );
+    assertThat( gateway, hasXPath( "/gateway/resource[2]/filter[7]/class", equalTo( "org.apache.hadoop.gateway.hdfs.dispatch.HdfsDispatch"
) ) );
   }
 
   private Document parse( InputStream stream ) throws IOException, SAXException, ParserConfigurationException
{


Mime
View raw message