aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src
diff options
context:
space:
mode:
authorArne Juul <arnej@vespa.ai>2023-10-26 13:52:15 +0000
committerArne Juul <arnej@vespa.ai>2023-10-26 13:52:15 +0000
commitec1c22c585fc18167e08b4f095431c98def5229b (patch)
treef81754ccb0b48852e76878d914d3a07ce99b1c7f /vespajlib/src
parentbce3b8e926bf9da880172acbe1ba4b12d5e026d6 (diff)
switch to io.airlift:aircompressor
Diffstat (limited to 'vespajlib/src')
-rw-r--r--vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java b/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java
index 5bec9aa4e8a..245a672de20 100644
--- a/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java
+++ b/vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java
@@ -11,8 +11,8 @@ import java.util.Arrays;
*/
public class ZstdCompressor {
- private static final ai.vespa.airlift.zstd.ZstdCompressor compressor = new ai.vespa.airlift.zstd.ZstdCompressor();
- private static final ai.vespa.airlift.zstd.ZstdDecompressor decompressor = new ai.vespa.airlift.zstd.ZstdDecompressor();
+ private io.airlift.compress.zstd.ZstdCompressor compressor = new io.airlift.compress.zstd.ZstdCompressor();
+ private io.airlift.compress.zstd.ZstdDecompressor decompressor = new io.airlift.compress.zstd.ZstdDecompressor();
public byte[] compress(byte[] input, int inputOffset, int inputLength) {
int maxCompressedLength = getMaxCompressedLength(inputLength);
@@ -41,12 +41,14 @@ public class ZstdCompressor {
return decompressor.decompress(input, inputOffset, inputLength, output, outputOffset, maxOutputLength);
}
+ private static final io.airlift.compress.Compressor threadUnsafe = new io.airlift.compress.zstd.ZstdCompressor();
+
public static int getMaxCompressedLength(int uncompressedLength) {
- return compressor.maxCompressedLength(uncompressedLength);
+ return threadUnsafe.maxCompressedLength(uncompressedLength);
}
public static int getDecompressedLength(byte[] input, int inputOffset, int inputLength) {
- return (int) ai.vespa.airlift.zstd.ZstdDecompressor.getDecompressedSize(input, inputOffset, inputLength);
+ return (int) io.airlift.compress.zstd.ZstdDecompressor.getDecompressedSize(input, inputOffset, inputLength);
}
}