knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject [36/41] knox git commit: Fixed merge issues with master KNOX-481
Date Thu, 12 Feb 2015 16:22:18 GMT
Fixed merge issues with master KNOX-481


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

Branch: refs/heads/KNOX-481
Commit: 82556478c0c0a5f531214b149781a9575f61a2f8
Parents: 210df67
Author: Sumit Gupta <sumit@apache.org>
Authored: Thu Jan 29 19:39:08 2015 -0500
Committer: Sumit Gupta <sumit@apache.org>
Committed: Wed Feb 11 15:51:11 2015 -0500

----------------------------------------------------------------------
 .../impl/DispatchDeploymentContributor.java     | 23 ++++++++++++--------
 .../HBaseDispatchDeploymentContributor.java     | 22 +++++++++++--------
 .../hive/HiveDispatchDeploymentContributor.java | 22 +++++++++++--------
 .../gateway/dispatch/HttpClientDispatch.java    |  3 ---
 .../deploy/DeploymentFactoryFuncTest.java       |  2 ++
 5 files changed, 42 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/82556478/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 6f71c23..4d272c2 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
@@ -28,6 +28,7 @@ import org.apache.hadoop.gateway.topology.Provider;
 import org.apache.hadoop.gateway.topology.Service;
 
 import java.util.List;
+import java.util.Map;
 
 public class DispatchDeploymentContributor extends ProviderDeploymentContributorBase {
   
@@ -50,18 +51,22 @@ public class DispatchDeploymentContributor extends ProviderDeploymentContributor
 
   @Override
   public void contributeFilter( DeploymentContext context, Provider provider, Service service,
ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    String replayBufferSize = DEFAULT_REPLAY_BUFFER_SIZE;
-    if (params != null) {
-      for (FilterParamDescriptor paramDescriptor : params) {
-        if (REPLAY_BUFFER_SIZE_PARAM.equals( paramDescriptor.name() )) {
-          replayBufferSize = paramDescriptor.value();
-          break;
+    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
+    filter.param().name(DISPATCH_IMPL_PARAM).value(HttpClientDispatch.class.getName());
+    FilterParamDescriptor filterParam = filter.param().name( REPLAY_BUFFER_SIZE_PARAM ).value(
DEFAULT_REPLAY_BUFFER_SIZE );
+    for ( Map.Entry<String,String> serviceParam : service.getParams().entrySet() )
{
+      if ( REPLAY_BUFFER_SIZE_PARAM.equals( serviceParam.getKey() ) ) {
+        filterParam.value( serviceParam.getValue() );
+      }
+    }
+    if ( params != null ) {
+      for ( FilterParamDescriptor customParam : params ) {
+        if ( REPLAY_BUFFER_SIZE_PARAM.equals( customParam.name() ) ) {
+          filterParam.value( customParam.value() );
         }
       }
     }
-    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
-    filter.param().name(DISPATCH_IMPL_PARAM).value(HttpClientDispatch.class.getName());
-    filter.param().name(REPLAY_BUFFER_SIZE_PARAM).value(replayBufferSize);
+
     if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
       filter.param().name("kerberos").value("true");
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/82556478/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
index d7bc368..b84380a 100644
--- a/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
+++ b/gateway-service-hbase/src/main/java/org/apache/hadoop/gateway/hbase/HBaseDispatchDeploymentContributor.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.gateway.topology.Provider;
 import org.apache.hadoop.gateway.topology.Service;
 
 import java.util.List;
+import java.util.Map;
 
 public class HBaseDispatchDeploymentContributor extends ProviderDeploymentContributorBase
{
   
@@ -50,18 +51,21 @@ public class HBaseDispatchDeploymentContributor extends ProviderDeploymentContri
 
   @Override
   public void contributeFilter( DeploymentContext context, Provider provider, Service service,
ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    String replayBufferSize = DEFAULT_REPLAY_BUFFER_SIZE;
-    if (params != null) {
-      for (FilterParamDescriptor paramDescriptor : params) {
-        if (REPLAY_BUFFER_SIZE_PARAM.equals( paramDescriptor.name() )) {
-          replayBufferSize = paramDescriptor.value();
-          break;
+    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
+    filter.param().name(DISPATCH_IMPL_PARAM).value(HBaseHttpClientDispatch.class.getName());
+    FilterParamDescriptor filterParam = filter.param().name( REPLAY_BUFFER_SIZE_PARAM ).value(
DEFAULT_REPLAY_BUFFER_SIZE );
+    for ( Map.Entry<String,String> serviceParam : service.getParams().entrySet() )
{
+      if ( REPLAY_BUFFER_SIZE_PARAM.equals( serviceParam.getKey() ) ) {
+        filterParam.value( serviceParam.getValue() );
+      }
+    }
+    if ( params != null ) {
+      for ( FilterParamDescriptor customParam : params ) {
+        if ( REPLAY_BUFFER_SIZE_PARAM.equals( customParam.name() ) ) {
+          filterParam.value( customParam.value() );
         }
       }
     }
-    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
-    filter.param().name(DISPATCH_IMPL_PARAM).value(HBaseHttpClientDispatch.class.getName());
-    filter.param().name("replayBufferSize").value(replayBufferSize);
     if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
       filter.param().name("kerberos").value("true");
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/82556478/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
index 1be8fe8..ca40d81 100644
--- a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
+++ b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatchDeploymentContributor.java
@@ -18,6 +18,7 @@
 package org.apache.hadoop.gateway.hive;
 
 import java.util.List;
+import java.util.Map;
 
 import org.apache.hadoop.gateway.deploy.DeploymentContext;
 import org.apache.hadoop.gateway.deploy.ProviderDeploymentContributorBase;
@@ -52,18 +53,21 @@ public class HiveDispatchDeploymentContributor extends ProviderDeploymentContrib
 
   @Override
   public void contributeFilter( DeploymentContext context, Provider provider, Service service,
ResourceDescriptor resource, List<FilterParamDescriptor> params ) {
-    String replayBufferSize = DEFAULT_REPLAY_BUFFER_SIZE;
-    if (params != null) {
-      for (FilterParamDescriptor paramDescriptor : params) {
-        if (REPLAY_BUFFER_SIZE_PARAM.equals( paramDescriptor.name() )) {
-          replayBufferSize = paramDescriptor.value();
-          break;
+    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
+    filter.param().name(DISPATCH_IMPL_PARAM).value(HiveHttpClientDispatch.class.getName());
+    FilterParamDescriptor filterParam = filter.param().name( REPLAY_BUFFER_SIZE_PARAM ).value(
DEFAULT_REPLAY_BUFFER_SIZE );
+    for ( Map.Entry<String,String> serviceParam : service.getParams().entrySet() )
{
+      if ( REPLAY_BUFFER_SIZE_PARAM.equals( serviceParam.getKey() ) ) {
+        filterParam.value( serviceParam.getValue() );
+      }
+    }
+    if ( params != null ) {
+      for ( FilterParamDescriptor customParam : params ) {
+        if ( REPLAY_BUFFER_SIZE_PARAM.equals( customParam.name() ) ) {
+          filterParam.value( customParam.value() );
         }
       }
     }
-    FilterDescriptor filter = resource.addFilter().name( getName() ).role( getRole() ).impl(
GatewayDispatchFilter.class );
-    filter.param().name(DISPATCH_IMPL_PARAM).value(HiveHttpClientDispatch.class.getName());
-    filter.param().name("replayBufferSize").value(replayBufferSize);
     if( context.getGatewayConfig().isHadoopKerberosSecured() ) {
       filter.param().name("kerberos").value("true");
     }

http://git-wip-us.apache.org/repos/asf/knox/blob/82556478/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
index 78fbdb1..8c5b4f9 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatch.java
@@ -75,12 +75,9 @@ public class HttpClientDispatch extends AbstractGatewayDispatch {
   protected static SpiGatewayResources RES = ResourcesFactory.get(SpiGatewayResources.class);
   protected static Auditor auditor = AuditServiceFactory.getAuditService().getAuditor(AuditConstants.DEFAULT_AUDITOR_NAME,
       AuditConstants.KNOX_SERVICE_NAME, AuditConstants.KNOX_COMPONENT_NAME);
-  private static final int DEFAULT_REPLAY_BUFFER_SIZE = 4 * 1024; // 4K
 
   protected AppCookieManager appCookieManager;
 
-  protected static final String REPLAY_BUFFER_SIZE_PARAM = "replayBufferSize";
-
   private int replayBufferSize = 0;
 
   @Override

http://git-wip-us.apache.org/repos/asf/knox/blob/82556478/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 a983e6e..c2fb69f 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
@@ -382,6 +382,7 @@ public class DeploymentFactoryFuncTest {
     ((GatewayTestConfig) config).setGatewayHomeDir(gatewayDir.getAbsolutePath());
     File deployDir = new File(config.getGatewayDeploymentDir());
     deployDir.mkdirs();
+    addStacksDir(config, targetDir);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
     Map<String, String> options = new HashMap<String, String>();
@@ -456,6 +457,7 @@ public class DeploymentFactoryFuncTest {
     ((GatewayTestConfig) config).setGatewayHomeDir(gatewayDir.getAbsolutePath());
     File deployDir = new File(config.getGatewayDeploymentDir());
     deployDir.mkdirs();
+    addStacksDir(config, targetDir);
 
     DefaultGatewayServices srvcs = new DefaultGatewayServices();
     Map<String, String> options = new HashMap<String, String>();


Mime
View raw message