Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.List;

class ZstdCompressor extends Compressor {
private static final int DEFAULT_COMPRESSION_LEVEL = 3;

@Override
public String getName() {
return "zstd";
Expand All @@ -46,7 +48,7 @@ public void compress(final List<ByteBuf> source, final BsonOutput target) {

try {
byte[] out = new byte[(int) Zstd.compressBound(uncompressedSize)];
int compressedSize = (int) Zstd.compress(out, singleByteArraySource, Zstd.maxCompressionLevel());
int compressedSize = (int) Zstd.compress(out, singleByteArraySource, DEFAULT_COMPRESSION_LEVEL);
target.writeBytes(out, 0, compressedSize);
} catch (RuntimeException e) {
throw new MongoInternalException("Unexpected RuntimeException", e);
Expand Down