Skip to content

Commit

Permalink
Use NoFinalizer classes for ZSTD
Browse files Browse the repository at this point in the history
  • Loading branch information
pnv1 committed Oct 21, 2024
1 parent 81fdf62 commit 84e9845
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions topic/src/main/java/tech/ydb/topic/utils/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;

import com.github.luben.zstd.ZstdInputStream;
import com.github.luben.zstd.ZstdOutputStream;
import com.github.luben.zstd.ZstdInputStreamNoFinalizer;
import com.github.luben.zstd.ZstdOutputStreamNoFinalizer;
import org.anarres.lzo.LzoAlgorithm;
import org.anarres.lzo.LzoCompressor;
import org.anarres.lzo.LzoLibrary;
Expand Down Expand Up @@ -61,7 +61,7 @@ private static OutputStream makeOutputStream(Codec codec,
case GZIP:
return new GZIPOutputStream(byteArrayOutputStream);
case ZSTD:
return new ZstdOutputStream(byteArrayOutputStream);
return new ZstdOutputStreamNoFinalizer(byteArrayOutputStream);
case LZOP:
LzoCompressor lzoCompressor = LzoLibrary.getInstance().newCompressor(LzoAlgorithm.LZO1X, null);
return new LzoOutputStream(byteArrayOutputStream, lzoCompressor);
Expand All @@ -77,7 +77,7 @@ private static InputStream makeInputStream(Codec codec,
case GZIP:
return new GZIPInputStream(byteArrayInputStream);
case ZSTD:
return new ZstdInputStream(byteArrayInputStream);
return new ZstdInputStreamNoFinalizer(byteArrayInputStream);
case LZOP:
return new LzopInputStream(byteArrayInputStream);
case CUSTOM:
Expand Down

0 comments on commit 84e9845

Please sign in to comment.