diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-03-15 09:41:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 09:41:56 +0100 |
commit | 77926c9c0ca9128d9d75fd49e614dc62465ca45e (patch) | |
tree | 82dcb6c32ad503c5a86feb8d8895cd3b4cbf95a5 /config/src | |
parent | 2282573750e27af311dfe2c09da88233f58c4ab4 (diff) | |
parent | 513c631985568d4b60aa9fffef1809d5f7a6f07d (diff) |
Merge pull request #16944 from vespa-engine/hmusum/gc-unused-env-variables
GC unused env variables
Diffstat (limited to 'config/src')
3 files changed, 16 insertions, 37 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java b/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java index ba2caaf3e91..688d6d54888 100644 --- a/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java +++ b/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java @@ -18,7 +18,6 @@ public class LZ4PayloadCompressor { private static int getCompressionLevel() { return Integer.parseInt(ConfigUtils.getEnvValue("0", System.getenv(VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL), - System.getenv("services__config_protocol_compression_level"), System.getProperty(VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL))); } diff --git a/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactory.java b/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactory.java index b6277f750dc..953be93b67b 100644 --- a/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactory.java +++ b/config/src/main/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactory.java @@ -1,4 +1,4 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.protocol; import com.yahoo.config.ConfigInstance; @@ -30,12 +30,11 @@ public class JRTConfigRequestFactory { public static CompressionType getCompressionType() { return getCompressionType(System.getenv(VESPA_CONFIG_PROTOCOL_COMPRESSION), - System.getenv("services__config_protocol_compression"), - System.getProperty(VESPA_CONFIG_PROTOCOL_COMPRESSION)); + System.getProperty(VESPA_CONFIG_PROTOCOL_COMPRESSION)); } - static CompressionType getCompressionType(String env, String alternateEnv, String property) { - return CompressionType.valueOf(ConfigUtils.getEnvValue("LZ4", env, alternateEnv, property)); + static CompressionType getCompressionType(String env, String property) { + return CompressionType.valueOf(ConfigUtils.getEnvValue("LZ4", env, property)); } static Optional<VespaVersion> getVespaVersion() { diff --git a/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactoryTest.java b/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactoryTest.java index 04f3a7abe29..c1d381725e4 100644 --- a/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactoryTest.java +++ b/config/src/test/java/com/yahoo/vespa/config/protocol/JRTConfigRequestFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config.protocol; import com.yahoo.foo.FunctionTestConfig; @@ -17,41 +17,22 @@ import static org.hamcrest.MatcherAssert.assertThat; * @author hmusum */ public class JRTConfigRequestFactoryTest { - private static VespaVersion defaultVespaVersion = JRTConfigRequestFactory.getCompiledVespaVersion(); + private static final VespaVersion defaultVespaVersion = JRTConfigRequestFactory.getCompiledVespaVersion(); @Test public void testCompressionType() { - assertThat(JRTConfigRequestFactory.getCompressionType("", "", ""), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("", ""), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", ""), is(CompressionType.UNCOMPRESSED)); + assertThat(JRTConfigRequestFactory.getCompressionType("", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); + assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "", ""), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "UNCOMPRESSED", ""), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "UNCOMPRESSED", ""), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "UNCOMPRESSED", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "UNCOMPRESSED", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); + assertThat(JRTConfigRequestFactory.getCompressionType("", ""), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", ""), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("", "LZ4"), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "LZ4"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "", ""), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "LZ4", ""), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "", "LZ4"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "LZ4", ""), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "", "LZ4"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "LZ4", "LZ4"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "LZ4", "LZ4"), is(CompressionType.LZ4)); - - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "LZ4", ""), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "", "LZ4"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "UNCOMPRESSED", "LZ4"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "UNCOMPRESSED", ""), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "", "UNCOMPRESSED"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("", "LZ4", "UNCOMPRESSED"), is(CompressionType.LZ4)); - - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "LZ4", "LZ4"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "UNCOMPRESSED", "LZ4"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "LZ4", "UNCOMPRESSED"), is(CompressionType.UNCOMPRESSED)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "UNCOMPRESSED", "UNCOMPRESSED"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "UNCOMPRESSED", "LZ4"), is(CompressionType.LZ4)); - assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "LZ4", "UNCOMPRESSED"), is(CompressionType.LZ4)); + assertThat(JRTConfigRequestFactory.getCompressionType("UNCOMPRESSED", "LZ4"), is(CompressionType.UNCOMPRESSED)); + assertThat(JRTConfigRequestFactory.getCompressionType("LZ4", "UNCOMPRESSED"), is(CompressionType.LZ4)); } @Test |