Class ZstdByteBuffDecompressor
java.lang.Object
org.apache.hadoop.hbase.io.compress.zstd.ZstdByteBuffDecompressor
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteBuffDecompressor
,CanReinit
@Private
public class ZstdByteBuffDecompressor
extends Object
implements ByteBuffDecompressor, CanReinit
Glue for ByteBuffDecompressor on top of zstd-jni
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
protected com.github.luben.zstd.ZstdDecompressCtx
protected com.github.luben.zstd.ZstdDictDecompress
protected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecompress
(ByteBuff output, ByteBuff input) Signals of these two particularByteBuff
s are compatible with this decompressor.void
close()
int
decompress
(ByteBuff output, ByteBuff input, int inputLen) Fills the ouput buffer with uncompressed data.private int
decompressDirectByteBuffers
(ByteBuffer output, ByteBuffer input, int inputLen) private int
decompressHeapByteBuffers
(ByteBuffer output, ByteBuffer input, int inputLen) private int
decompressRaw
(ByteBuff output, ByteBuff input, int inputLen) void
reinit
(org.apache.hadoop.conf.Configuration conf)
-
Field Details
-
dictId
-
dict
-
ctx
-
allowByteBuffDecompression
-
-
Constructor Details
-
ZstdByteBuffDecompressor
ZstdByteBuffDecompressor(@Nullable byte[] dictionary)
-
-
Method Details
-
canDecompress
Description copied from interface:ByteBuffDecompressor
Signals of these two particularByteBuff
s are compatible with this decompressor. ByteBuffs can have one or multiple backing buffers, and each of these may be stored in heap or direct memory. DifferentByteBuffDecompressor
s may be able to handle different combinations of these, so always check.- Specified by:
canDecompress
in interfaceByteBuffDecompressor
-
decompress
Description copied from interface:ByteBuffDecompressor
Fills the ouput buffer with uncompressed data. Always callByteBuffDecompressor.canDecompress(ByteBuff, ByteBuff)
first to check if this decompressor can handle your input and output buffers.- Specified by:
decompress
in interfaceByteBuffDecompressor
- Returns:
- The actual number of bytes of uncompressed data.
- Throws:
IOException
-
decompressRaw
- Throws:
IOException
-
decompressDirectByteBuffers
-
decompressHeapByteBuffers
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
reinit
-