public abstract class CodecFactory extends Object
null
deflate
snappy
bzip2
addCodec(String, CodecFactory)
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_DEFLATE_LEVEL |
static int |
DEFAULT_XZ_LEVEL |
static boolean |
DEFAULT_ZSTANDARD_BUFFERPOOL |
static int |
DEFAULT_ZSTANDARD_LEVEL |
Constructor and Description |
---|
CodecFactory() |
Modifier and Type | Method and Description |
---|---|
static CodecFactory |
addCodec(String name,
CodecFactory c)
Adds a new codec implementation.
|
static CodecFactory |
bzip2Codec()
bzip2 codec.
|
protected abstract Codec |
createInstance()
Creates internal Codec.
|
static CodecFactory |
deflateCodec(int compressionLevel)
Deflate codec, with specific compression.
|
static CodecFactory |
fromString(String s)
Maps a codec name into a CodecFactory.
|
static CodecFactory |
nullCodec()
Null codec, for no compression.
|
static CodecFactory |
snappyCodec()
Snappy codec.
|
String |
toString() |
static CodecFactory |
xzCodec(int compressionLevel)
XZ codec, with specific compression.
|
static CodecFactory |
zstandardCodec(int level)
zstandard codec, with specific compression level.
|
static CodecFactory |
zstandardCodec(int level,
boolean useChecksum)
zstandard codec, with specific compression level.
|
static CodecFactory |
zstandardCodec(int level,
boolean useChecksum,
boolean useBufferPool)
zstandard codec, with specific compression level, checksum, and bufferPool
|
public static final int DEFAULT_DEFLATE_LEVEL
public static final int DEFAULT_XZ_LEVEL
public static final int DEFAULT_ZSTANDARD_LEVEL
public static final boolean DEFAULT_ZSTANDARD_BUFFERPOOL
public static CodecFactory nullCodec()
public static CodecFactory deflateCodec(int compressionLevel)
public static CodecFactory xzCodec(int compressionLevel)
public static CodecFactory snappyCodec()
public static CodecFactory bzip2Codec()
public static CodecFactory zstandardCodec(int level)
level
- The compression level should be between -5 and 22, inclusive.
Negative levels are 'fast' modes akin to lz4 or snappy, levels
above 9 are generally for archival purposes, and levels above 18
use a lot of memory.public static CodecFactory zstandardCodec(int level, boolean useChecksum)
level
- The compression level should be between -5 and 22,
inclusive. Negative levels are 'fast' modes akin to lz4 or
snappy, levels above 9 are generally for archival
purposes, and levels above 18 use a lot of memory.useChecksum
- if true, will include a checksum with each data blockpublic static CodecFactory zstandardCodec(int level, boolean useChecksum, boolean useBufferPool)
level
- The compression level should be between -5 and 22,
inclusive. Negative levels are 'fast' modes akin to lz4
or snappy, levels above 9 are generally for archival
purposes, and levels above 18 use a lot of memory.useChecksum
- if true, will include a checksum with each data blockuseBufferPool
- if true, will use recycling buffer poolprotected abstract Codec createInstance()
public static CodecFactory fromString(String s)
null
deflate
snappy
bzip2
xz
zstandard
public static CodecFactory addCodec(String name, CodecFactory c)
Copyright © 2009–2021 The Apache Software Foundation. All rights reserved.