public enum Compression extends java.lang.Enum<Compression>
Enum Constant and Description |
---|
AUTO
When reading a file, automatically determine the compression type based on filename extension.
|
BZIP2
BZip compression.
|
DEFLATE
Deflate compression.
|
GZIP
GZip compression.
|
LZO
LZO compression using LZO codec.
|
LZOP
LZOP compression using LZOP codec.
|
UNCOMPRESSED
No compression.
|
ZIP
Zip compression.
|
ZSTD
ZStandard compression.
|
Modifier and Type | Method and Description |
---|---|
static Compression |
detect(java.lang.String filename) |
java.lang.String |
getSuggestedSuffix() |
boolean |
isCompressed(java.lang.String filename) |
boolean |
matches(java.lang.String filename) |
abstract java.nio.channels.ReadableByteChannel |
readDecompressed(java.nio.channels.ReadableByteChannel channel) |
static Compression |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Compression[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract java.nio.channels.WritableByteChannel |
writeCompressed(java.nio.channels.WritableByteChannel channel) |
public static final Compression AUTO
public static final Compression UNCOMPRESSED
public static final Compression GZIP
public static final Compression BZIP2
public static final Compression ZIP
public static final Compression ZSTD
The .zst
extension is specified in RFC
8478.
The Beam Java SDK does not pull in the Zstd library by default, so it is the user's
responsibility to declare an explicit dependency on zstd-jni
. Attempts to read or write
.zst files without zstd-jni
loaded will result in NoClassDefFoundError
at
runtime.
public static final Compression LZO
.lzo_deflate
extension is specified for files which
use the LZO algorithm without headers.
The Beam Java SDK does not pull in the required libraries for LZO compression by default, so
it is the user's responsibility to declare an explicit dependency on io.airlift:aircompressor
and com.facebook.presto.hadoop:hadoop-apache2
. Attempts to
read or write .lzo_deflate
files without io.airlift:aircompressor
and com.facebook.presto.hadoop:hadoop-apache2
loaded will result in a NoClassDefFoundError
at runtime.
public static final Compression LZOP
.lzo
extension is specified for files with magic
bytes and headers.
Warning: The LZOP codec being used does not support concatenated LZOP streams and will silently ignore data after the end of the first LZOP stream.
The Beam Java SDK does not pull in the required libraries for LZOP compression by default,
so it is the user's responsibility to declare an explicit dependency on io.airlift:aircompressor
and com.facebook.presto.hadoop:hadoop-apache2
. Attempts to
read or write .lzo
files without io.airlift:aircompressor
and com.facebook.presto.hadoop:hadoop-apache2
loaded will result in a NoClassDefFoundError
at runtime.
public static final Compression DEFLATE
public static Compression[] values()
for (Compression c : Compression.values()) System.out.println(c);
public static Compression valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getSuggestedSuffix()
public boolean matches(java.lang.String filename)
public boolean isCompressed(java.lang.String filename)
public static Compression detect(java.lang.String filename)
public abstract java.nio.channels.ReadableByteChannel readDecompressed(java.nio.channels.ReadableByteChannel channel) throws java.io.IOException
java.io.IOException
public abstract java.nio.channels.WritableByteChannel writeCompressed(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
java.io.IOException