Class AbstractCompressionCodec
java.lang.Object
org.apache.arrow.vector.compression.AbstractCompressionCodec
- All Implemented Interfaces:
CompressionCodec
- Direct Known Subclasses:
Lz4CompressionCodec
,ZstdCompressionCodec
The base class for concrete compression codecs, providing common logic for all compression
codecs.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.arrow.vector.compression.CompressionCodec
CompressionCodec.Factory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompress
(BufferAllocator allocator, ArrowBuf uncompressedBuffer) Compress a buffer.decompress
(BufferAllocator allocator, ArrowBuf compressedBuffer) Decompress a buffer.protected abstract ArrowBuf
doCompress
(BufferAllocator allocator, ArrowBuf uncompressedBuffer) The method that actually performs the data compression.protected abstract ArrowBuf
doDecompress
(BufferAllocator allocator, ArrowBuf compressedBuffer) The method that actually performs the data decompression.protected long
readUncompressedLength
(ArrowBuf compressedBuffer) protected void
writeUncompressedLength
(ArrowBuf compressedBuffer, long uncompressedLength) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.arrow.vector.compression.CompressionCodec
getCodecType
-
Constructor Details
-
AbstractCompressionCodec
public AbstractCompressionCodec()
-
-
Method Details
-
compress
Description copied from interface:CompressionCodec
Compress a buffer.- Specified by:
compress
in interfaceCompressionCodec
- Parameters:
allocator
- the allocator for allocating memory for compressed buffer.uncompressedBuffer
- the buffer to compress. Implementation of this method should take care of releasing this buffer.- Returns:
- the compressed buffer
-
decompress
Description copied from interface:CompressionCodec
Decompress a buffer.- Specified by:
decompress
in interfaceCompressionCodec
- Parameters:
allocator
- the allocator for allocating memory for decompressed buffer.compressedBuffer
- the buffer to be decompressed. Implementation of this method should take care of releasing this buffer.- Returns:
- the decompressed buffer.
-
writeUncompressedLength
-
readUncompressedLength
-
doCompress
The method that actually performs the data compression. The layout of the returned compressed buffer is the compressed data, plus 8 bytes reserved at the beginning of the buffer for the uncompressed data size.Please note that this method is not responsible for releasing the uncompressed buffer.
-
doDecompress
The method that actually performs the data decompression. The layout of the compressed buffer is the compressed data, plus 8 bytes at the beginning of the buffer storing the uncompressed data size.Please note that this method is not responsible for releasing the compressed buffer.
-