Interface CompressionCodecFactory
CompressionCodecFactory.BytesInputCompressor and CompressionCodecFactory.BytesInputDecompressor
instances to compress/decompress page data.
The factory instance shall be released after use. The compressor/decompressor instances shall not be used after release.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCompressor instance of a specific codec to be used for compressing page data.static interfaceDecompressor instance of a specific codec to be used for decompressing page data. -
Method Summary
Modifier and TypeMethodDescriptiongetCompressor(CompressionCodecName codecName) Returns aCompressionCodecFactory.BytesInputCompressorinstance for the specified codec name to be used for compressing page data.getCompressor(CompressionCodecName codecName, int level) Returns aCompressionCodecFactory.BytesInputCompressorinstance for the specified codec name and compression level.getDecompressor(CompressionCodecName codecName) Returns aCompressionCodecFactory.BytesInputDecompressorinstance for the specified codec name to be used for decompressing page data.voidrelease()Releasing this factory instance.
-
Method Details
-
getCompressor
Returns aCompressionCodecFactory.BytesInputCompressorinstance for the specified codec name to be used for compressing page data.The compressor is not thread-safe, so one instance for each working thread is required.
- Parameters:
codecName- the codec name which the compressor instance is to be returned- Returns:
- the compressor instance for the specified codec name
- See Also:
-
getCompressor
default CompressionCodecFactory.BytesInputCompressor getCompressor(CompressionCodecName codecName, int level) Returns aCompressionCodecFactory.BytesInputCompressorinstance for the specified codec name and compression level.The compression level controls the trade-off between compression speed and ratio. The valid range and meaning of the level is codec-specific:
- ZSTD: negative levels trade compression ratio for higher speed, up to 22 for best compression, default 3; the exact bounds are defined by the zstd library
- GZIP: 1 (fastest) to 9 (best compression), default 6
- BROTLI: 0 (fastest) to 11 (best compression), default 1
levelparameter and delegate togetCompressor(CompressionCodecName).The compressor is not thread-safe, so one instance for each working thread is required.
- Parameters:
codecName- the codec name which the compressor instance is to be returnedlevel- the compression level; codec-specific, ignored if the codec does not support levels- Returns:
- the compressor instance for the specified codec name and level
- See Also:
-
getDecompressor
Returns aCompressionCodecFactory.BytesInputDecompressorinstance for the specified codec name to be used for decompressing page data.The decompressor is not thread-safe, so one instance for each working thread is required.
- Parameters:
codecName- the codec name which the decompressor instance is to be returned- Returns:
- the decompressor instance for the specified codec name
- See Also:
-
release
void release()Releasing this factory instance.Each compressor/decompressor instance shall be released before invoking this. Nor the compressor/decompressor instances retrieved from this factory nor this factory instance itself shall be used after release.
-