You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by lm...@apache.org on 2017/03/03 14:18:42 UTC
knox git commit: KNOX-890 - Make IdleTimeout Configurable in Knox
Gateway Server (make default 5 mins)
Repository: knox
Updated Branches:
refs/heads/master 56d444fd8 -> 1ce0e9b6c
KNOX-890 - Make IdleTimeout Configurable in Knox Gateway Server (make default 5 mins)
Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/1ce0e9b6
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/1ce0e9b6
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/1ce0e9b6
Branch: refs/heads/master
Commit: 1ce0e9b6cf8a5f80cab28da1a1c739013bcb6d54
Parents: 56d444f
Author: Larry McCay <lm...@hortonworks.com>
Authored: Fri Mar 3 09:18:31 2017 -0500
Committer: Larry McCay <lm...@hortonworks.com>
Committed: Fri Mar 3 09:18:31 2017 -0500
----------------------------------------------------------------------
.../hadoop/gateway/config/impl/GatewayConfigImpl.java | 2 +-
.../gateway/config/impl/GatewayConfigImplTest.java | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/knox/blob/1ce0e9b6/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
index 6bc75a9..65ba8ea 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
@@ -639,7 +639,7 @@ public class GatewayConfigImpl extends Configuration implements GatewayConfig {
@Override
public long getGatewayIdleTimeout() {
- return getLong(GATEWAY_IDLE_TIMEOUT, 0l);
+ return getLong(GATEWAY_IDLE_TIMEOUT, 300000l);
}
@Override
http://git-wip-us.apache.org/repos/asf/knox/blob/1ce0e9b6/gateway-server/src/test/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImplTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImplTest.java b/gateway-server/src/test/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImplTest.java
index 9cf7a39..24b45b1 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImplTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImplTest.java
@@ -191,4 +191,17 @@ public class GatewayConfigImplTest {
assertThat(config.getGraphitePort(), is(32772));
}
+ @Test( timeout = TestUtils.SHORT_TIMEOUT )
+ public void testGatewayIdleTimeout() {
+ GatewayConfigImpl config = new GatewayConfigImpl();
+ long idleTimeout = 0l;
+
+ idleTimeout = config.getGatewayIdleTimeout();
+ assertThat( idleTimeout, is(300000L));
+
+ config.set( GatewayConfigImpl.GATEWAY_IDLE_TIMEOUT, "15000" );
+ idleTimeout = config.getGatewayIdleTimeout();
+ assertThat( idleTimeout, is(15000L));
+ }
+
}