Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<maven.compiler.release>25</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- production -->
<zstd.version>0.6</zstd.version>
<zstd.version>0.7</zstd.version>


<fastcsv.version>4.3.0</fastcsv.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import io.github.dfa1.vortex.reader.array.MaterializedShortArray;
import io.github.dfa1.vortex.reader.array.VarBinArray;

import io.github.dfa1.zstd.ZstdDecompressCtx;
import io.github.dfa1.zstd.ZstdDecompressDict;
import io.github.dfa1.zstd.ZstdDecompressContext;
import io.github.dfa1.zstd.ZstdDecompressDictionary;

import java.io.IOException;
import java.lang.foreign.Arena;
Expand Down Expand Up @@ -168,9 +168,9 @@ private static MemorySegment decompressFrames(
boolean hasDictionary = meta.dictionary_size() != 0;
int frameBufferBase = hasDictionary ? 1 : 0;
MemorySegment out = ctx.arena().allocate(totalUncompressed);
try (ZstdDecompressCtx dctx = new ZstdDecompressCtx();
try (ZstdDecompressContext dctx = new ZstdDecompressContext();
Arena scratch = Arena.ofConfined()) {
ZstdDecompressDict dictionary = hasDictionary
ZstdDecompressDictionary dictionary = hasDictionary
? digestDictionary(asNative(ctx.buffer(0), scratch), meta.dictionary_size())
: null;
try {
Expand Down Expand Up @@ -207,13 +207,13 @@ private static MemorySegment decompressFrames(
/// `declaredSize` is the metadata's `dictionary_size`; it must match the dictionary buffer's
/// byte size (the Rust reference enforces the same invariant), otherwise the segment is
/// malformed and we fail fast rather than digest a truncated dictionary.
private static ZstdDecompressDict digestDictionary(MemorySegment dictBuffer, long declaredSize) {
private static ZstdDecompressDictionary digestDictionary(MemorySegment dictBuffer, long declaredSize) {
if (dictBuffer.byteSize() != declaredSize) {
throw new VortexException(EncodingId.VORTEX_ZSTD,
"dictionary size metadata " + declaredSize
+ " does not match buffer size " + dictBuffer.byteSize());
}
return new ZstdDecompressDict(dictBuffer);
return new ZstdDecompressDictionary(dictBuffer);
}

/// Returns `seg` unchanged when it is already native (the production mmap path); otherwise
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.dfa1.vortex.writer.encode;

import io.github.dfa1.zstd.ZstdCompressCtx;
import io.github.dfa1.zstd.ZstdCompressContext;
import io.github.dfa1.vortex.core.model.DType;
import io.github.dfa1.vortex.core.model.PType;
import io.github.dfa1.vortex.core.error.VortexException;
Expand Down Expand Up @@ -241,7 +241,7 @@ private static Frames compressFrames(MemorySegment raw, FrameLayout layout, Aren
List<MemorySegment> compressed = new ArrayList<>(frameCount);
List<ProtoZstdFrameMetadata> metas = new ArrayList<>(frameCount);
long offset = 0;
try (ZstdCompressCtx cctx = new ZstdCompressCtx()) {
try (ZstdCompressContext cctx = new ZstdCompressContext()) {
for (int f = 0; f < frameCount; f++) {
long len = layout.byteLengths()[f];
compressed.add(cctx.compress(arena, raw.asSlice(offset, len)));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.dfa1.vortex.writer.encode;

import io.github.dfa1.zstd.Zstd;
import io.github.dfa1.zstd.ZstdCompressCtx;
import io.github.dfa1.zstd.ZstdCompressContext;
import io.github.dfa1.zstd.ZstdDictionary;
import io.github.dfa1.vortex.core.model.DType;
import io.github.dfa1.vortex.core.model.PType;
Expand Down Expand Up @@ -261,7 +261,7 @@ private static byte[] compress(byte[] input) {
}

private static byte[] compressWithDict(byte[] input, byte[] dict) {
try (ZstdCompressCtx cctx = new ZstdCompressCtx()) {
try (ZstdCompressContext cctx = new ZstdCompressContext()) {
return cctx.compress(input, ZstdDictionary.of(dict));
}
}
Expand Down
Loading