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 booleanprotected com.github.luben.zstd.ZstdDecompressCtxprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecompress(ByteBuff output, ByteBuff input) Signals of these two particularByteBuffs are compatible with this decompressor.voidclose()intdecompress(ByteBuff output, ByteBuff input, int inputLen) Fills the ouput buffer with uncompressed data.private intdecompressRaw(ByteBuff output, ByteBuff input, int inputLen) voidreinit(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:ByteBuffDecompressorSignals of these two particularByteBuffs 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. DifferentByteBuffDecompressors may be able to handle different combinations of these, so always check.- Specified by:
canDecompressin interfaceByteBuffDecompressor
-
decompress
Description copied from interface:ByteBuffDecompressorFills 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:
decompressin interfaceByteBuffDecompressor- Returns:
- The actual number of bytes of uncompressed data.
- Throws:
IOException
-
decompressRaw
- Throws:
IOException
-
reinit
Description copied from interface:ByteBuffDecompressorCall 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:
reinitin interfaceByteBuffDecompressor
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-