public class CodecFactory extends Object implements CompressionCodecFactory
| Modifier and Type | Class and Description |
|---|---|
static class |
CodecFactory.BytesCompressor
Deprecated.
will be removed in 2.0.0; use CompressionCodecFactory.BytesInputCompressor instead.
|
static class |
CodecFactory.BytesDecompressor
Deprecated.
will be removed in 2.0.0; use CompressionCodecFactory.BytesInputDecompressor instead.
|
CompressionCodecFactory.BytesInputCompressor, CompressionCodecFactory.BytesInputDecompressor| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,org.apache.hadoop.io.compress.CompressionCodec> |
CODEC_BY_NAME |
protected ParquetConfiguration |
conf |
protected org.apache.hadoop.conf.Configuration |
configuration
Deprecated.
|
protected int |
pageSize |
| Constructor and Description |
|---|
CodecFactory(org.apache.hadoop.conf.Configuration configuration,
int pageSize)
Create a new codec factory.
|
CodecFactory(ParquetConfiguration configuration,
int pageSize)
Create a new codec factory.
|
| Modifier and Type | Method and Description |
|---|---|
protected CodecFactory.BytesCompressor |
createCompressor(CompressionCodecName codecName) |
protected CodecFactory.BytesDecompressor |
createDecompressor(CompressionCodecName codecName) |
static CodecFactory |
createDirectCodecFactory(org.apache.hadoop.conf.Configuration config,
ByteBufferAllocator allocator,
int pageSize)
Create a codec factory that will provide compressors and decompressors
that will work natively with ByteBuffers backed by direct memory.
|
protected org.apache.hadoop.io.compress.CompressionCodec |
getCodec(CompressionCodecName codecName) |
CodecFactory.BytesCompressor |
getCompressor(CompressionCodecName codecName) |
CodecFactory.BytesDecompressor |
getDecompressor(CompressionCodecName codecName) |
void |
release() |
protected static final Map<String,org.apache.hadoop.io.compress.CompressionCodec> CODEC_BY_NAME
protected final ParquetConfiguration conf
protected final int pageSize
@Deprecated protected final org.apache.hadoop.conf.Configuration configuration
public CodecFactory(org.apache.hadoop.conf.Configuration configuration,
int pageSize)
configuration - used to pass compression codec configuration informationpageSize - the expected page size, does not set a hard limit, currently just
used to set the initial size of the output stream used when
compressing a buffer. If this factory is only used to construct
decompressors this parameter has no impact on the function of the factorypublic CodecFactory(ParquetConfiguration configuration, int pageSize)
configuration - used to pass compression codec configuration informationpageSize - the expected page size, does not set a hard limit, currently just
used to set the initial size of the output stream used when
compressing a buffer. If this factory is only used to construct
decompressors this parameter has no impact on the function of the factorypublic static CodecFactory createDirectCodecFactory(org.apache.hadoop.conf.Configuration config, ByteBufferAllocator allocator, int pageSize)
config - configuration options for different compression codecsallocator - an allocator for creating result buffers during compression
and decompression, must provide buffers backed by Direct
memory and return true for the isDirect() method
on the ByteBufferAllocator interfacepageSize - the default page size. This does not set a hard limit on the
size of buffers that can be compressed, but performance may
be improved by setting it close to the expected size of buffers
(in the case of parquet, pages) that will be compressed. This
setting is unused in the case of decompressing data, as parquet
always records the uncompressed size of a buffer. If this
CodecFactory is only going to be used for decompressors, this
parameter will not impact the function of the factory.public CodecFactory.BytesCompressor getCompressor(CompressionCodecName codecName)
getCompressor in interface CompressionCodecFactorypublic CodecFactory.BytesDecompressor getDecompressor(CompressionCodecName codecName)
getDecompressor in interface CompressionCodecFactoryprotected CodecFactory.BytesCompressor createCompressor(CompressionCodecName codecName)
protected CodecFactory.BytesDecompressor createDecompressor(CompressionCodecName codecName)
protected org.apache.hadoop.io.compress.CompressionCodec getCodec(CompressionCodecName codecName)
codecName - the requested codecpublic void release()
release in interface CompressionCodecFactoryCopyright © 2023 The Apache Software Foundation. All rights reserved.