Enum Class Compression
- All Implemented Interfaces:
Serializable,Comparable<Compression>,Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionWhen reading a file, automatically determine the compression type based on filename extension.BZip compression.Deflate compression.GZip compression.LZO compression using LZO codec.LZOP compression using LZOP codec.Google Snappy compression.No compression.Zip compression.ZStandard compression. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompressionbooleanisCompressed(String filename) booleanabstract ReadableByteChannelreadDecompressed(ReadableByteChannel channel) static CompressionReturns the enum constant of this class with the specified name.static Compression[]values()Returns an array containing the constants of this enum class, in the order they are declared.abstract WritableByteChannelwriteCompressed(WritableByteChannel channel)
-
Enum Constant Details
-
AUTO
When reading a file, automatically determine the compression type based on filename extension. Not applicable when writing files. -
UNCOMPRESSED
No compression. -
GZIP
GZip compression. -
BZIP2
BZip compression. -
ZIP
Zip compression. -
ZSTD
ZStandard compression.The
.zstextension 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 withoutzstd-jniloaded will result inNoClassDefFoundErrorat runtime. -
LZO
LZO compression using LZO codec..lzo_deflateextension 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:aircompressorandcom.facebook.presto.hadoop:hadoop-apache2. Attempts to read or write.lzo_deflatefiles withoutio.airlift:aircompressorandcom.facebook.presto.hadoop:hadoop-apache2loaded will result in aNoClassDefFoundErrorat runtime. -
LZOP
LZOP compression using LZOP codec..lzoextension 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:aircompressorandcom.facebook.presto.hadoop:hadoop-apache2. Attempts to read or write.lzofiles withoutio.airlift:aircompressorandcom.facebook.presto.hadoop:hadoop-apache2loaded will result in aNoClassDefFoundErrorat runtime. -
DEFLATE
Deflate compression. -
SNAPPY
Google Snappy compression.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getSuggestedSuffix
-
matches
-
isCompressed
-
detect
-
readDecompressed
public abstract ReadableByteChannel readDecompressed(ReadableByteChannel channel) throws IOException - Throws:
IOException
-
writeCompressed
- Throws:
IOException
-