Class ZstdByteBuffDecompressor
java.lang.Object
org.apache.hadoop.hbase.io.compress.zstd.ZstdByteBuffDecompressor
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteBuffDecompressor
Glue for ByteBuffDecompressor on top of zstd-jni
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
protected com.github.luben.zstd.ZstdDecompressCtx
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
decompressRaw
(ByteBuff output, ByteBuff input, int inputLen) void
reinit
(Compression.HFileDecompressionContext newHFileDecompressionContext) Call before every use ofByteBuffDecompressor.canDecompress(ByteBuff, ByteBuff)
andByteBuffDecompressor.decompress(ByteBuff, ByteBuff, int)
to reinitialize the decompressor with settings from the HFileInfo.
-
Field Details
-
dictId
-
ctx
-
allowByteBuffDecompression
-
-
Constructor Details
-
ZstdByteBuffDecompressor
ZstdByteBuffDecompressor(@Nullable byte[] dictionaryBytes)
-
-
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
-
reinit
Description copied from interface:ByteBuffDecompressor
Call before every use ofByteBuffDecompressor.canDecompress(ByteBuff, ByteBuff)
andByteBuffDecompressor.decompress(ByteBuff, ByteBuff, int)
to reinitialize the decompressor with settings from the HFileInfo. This can matter because ByteBuffDecompressors are reused many times.- Specified by:
reinit
in interfaceByteBuffDecompressor
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-