public class CodecFactory extends Object implements org.apache.parquet.compression.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.
|
org.apache.parquet.compression.CompressionCodecFactory.BytesInputCompressor, org.apache.parquet.compression.CompressionCodecFactory.BytesInputDecompressor| Modifier and Type | Field and Description |
|---|---|
protected static Map<String,org.apache.hadoop.io.compress.CompressionCodec> |
CODEC_BY_NAME |
protected org.apache.hadoop.conf.Configuration |
configuration |
protected int |
pageSize |
| Constructor and Description |
|---|
CodecFactory(org.apache.hadoop.conf.Configuration configuration,
int pageSize)
Create a new codec factory.
|
protected static final Map<String,org.apache.hadoop.io.compress.CompressionCodec> CODEC_BY_NAME
protected final org.apache.hadoop.conf.Configuration configuration
protected final int pageSize
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 static CodecFactory createDirectCodecFactory(org.apache.hadoop.conf.Configuration config, org.apache.parquet.bytes.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(org.apache.parquet.hadoop.metadata.CompressionCodecName codecName)
getCompressor in interface org.apache.parquet.compression.CompressionCodecFactorypublic CodecFactory.BytesDecompressor getDecompressor(org.apache.parquet.hadoop.metadata.CompressionCodecName codecName)
getDecompressor in interface org.apache.parquet.compression.CompressionCodecFactoryprotected CodecFactory.BytesCompressor createCompressor(org.apache.parquet.hadoop.metadata.CompressionCodecName codecName)
protected CodecFactory.BytesDecompressor createDecompressor(org.apache.parquet.hadoop.metadata.CompressionCodecName codecName)
protected org.apache.hadoop.io.compress.CompressionCodec getCodec(org.apache.parquet.hadoop.metadata.CompressionCodecName codecName)
codecName - the requested codecpublic void release()
release in interface org.apache.parquet.compression.CompressionCodecFactoryCopyright © 2019 The Apache Software Foundation. All rights reserved.