diff options
author | Harald Musum <musum@yahooinc.com> | 2021-09-07 18:07:17 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-09-07 18:07:17 +0200 |
commit | 065adc9fa40038c7f0491fe5ba3fa1b93af7c036 (patch) | |
tree | 9d37d2c9500afd7bc5ee334dd9d2b7514dd86ed2 | |
parent | 3d3c9117a600ccc7ca3cd924b60a2dde64b67f6b (diff) |
GC unused code for setting lz4 compression level
-rw-r--r-- | config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java | 14 |
1 files changed, 4 insertions, 10 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 03e08e039ae..2a992721c86 100644 --- a/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java +++ b/config/src/main/java/com/yahoo/vespa/config/LZ4PayloadCompressor.java @@ -1,9 +1,8 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.config; import com.yahoo.compress.CompressionType; import com.yahoo.compress.Compressor; -import com.yahoo.vespa.config.util.ConfigUtils; import java.nio.ByteBuffer; @@ -14,18 +13,12 @@ import java.nio.ByteBuffer; */ public class LZ4PayloadCompressor { - private static final String VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL = "VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL"; - private static final Compressor compressor = new Compressor(CompressionType.LZ4, getCompressionLevel()); - - private static int getCompressionLevel() { - return Integer.parseInt(ConfigUtils.getEnvValue("0", - System.getenv(VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL), - System.getProperty(VESPA_CONFIG_PROTOCOL_COMPRESSION_LEVEL))); - } + private static final Compressor compressor = new Compressor(CompressionType.LZ4, 0); public byte[] compress(byte[] input) { return compressor.compressUnconditionally(input); } + public byte[] compress(ByteBuffer input) { return compressor.compressUnconditionally(input); } @@ -33,6 +26,7 @@ public class LZ4PayloadCompressor { public byte [] decompress(byte[] input, int uncompressedLen) { return compressor.decompressUnconditionally(input, 0, uncompressedLen); } + public byte [] decompress(ByteBuffer input, int uncompressedLen) { ByteBuffer uncompressed = ByteBuffer.allocate(uncompressedLen); compressor.decompressUnconditionally(input, uncompressed); |