summaryrefslogtreecommitdiffstats
path: root/vespajlib
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
parentbce3b8e926bf9da880172acbe1ba4b12d5e026d6 (diff)
switch to io.airlift:aircompressor
Diffstat (limited to 'vespajlib')
-rw-r--r--vespajlib/pom.xml6
-rw-r--r--vespajlib/src/main/java/com/yahoo/compress/ZstdCompressor.java10
2 files changed, 9 insertions, 7 deletions
diff --git a/vespajlib/pom.xml b/vespajlib/pom.xml
index 99924fe36c3..a0dea8b29fc 100644
--- a/vespajlib/pom.xml
+++ b/vespajlib/pom.xml
@@ -32,9 +32,9 @@
<artifactId>jna</artifactId>
</dependency>
<dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>airlift-zstd</artifactId>
- <version>${project.version}</version>
+ <groupId>io.airlift</groupId>
+ <artifactId>aircompressor</artifactId>
+ <version>${aircompress.vespa.version}</version>
</dependency>
<dependency>
<groupId>net.openhft</groupId>
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);
}
}