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 Compression
boolean
isCompressed
(String filename) boolean
abstract ReadableByteChannel
readDecompressed
(ReadableByteChannel channel) static Compression
Returns 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 WritableByteChannel
writeCompressed
(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
.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 withoutzstd-jni
loaded will result inNoClassDefFoundError
at runtime. -
LZO
LZO compression using LZO codec..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
andcom.facebook.presto.hadoop:hadoop-apache2
. Attempts to read or write.lzo_deflate
files withoutio.airlift:aircompressor
andcom.facebook.presto.hadoop:hadoop-apache2
loaded will result in aNoClassDefFoundError
at runtime. -
LZOP
LZOP compression using LZOP codec..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
andcom.facebook.presto.hadoop:hadoop-apache2
. Attempts to read or write.lzo
files withoutio.airlift:aircompressor
andcom.facebook.presto.hadoop:hadoop-apache2
loaded will result in aNoClassDefFoundError
at 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
-