Class ZlibFactory
java.lang.Object
org.apache.hadoop.io.compress.zlib.ZlibFactory
A collection of factories to create the right
zlib/gzip compressor/decompressor instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic CompressorReturn the appropriate implementation of the zlib compressor.static Class<? extends Compressor>Return the appropriate type of the zlib compressor.static DecompressorReturn the appropriate implementation of the zlib decompressor.static Class<? extends Decompressor>Return the appropriate type of the zlib decompressor.static DirectDecompressorReturn the appropriate implementation of the zlib direct decompressor.static booleanCheck if native-zlib code is loaded & initialized correctly and can be loaded for this job.static voidLoad native library and set the flag whether to use native library.static voidstatic voidsetCompressionStrategy(Configuration conf, ZlibCompressor.CompressionStrategy strategy) static voidsetNativeZlibLoaded(boolean isLoaded) Set the flag whether to use native library.
-
Constructor Details
-
ZlibFactory
public ZlibFactory()
-
-
Method Details
-
loadNativeZLib
@VisibleForTesting public static void loadNativeZLib()Load native library and set the flag whether to use native library. The method is also used for reset the flag modified by setNativeZlibLoaded -
setNativeZlibLoaded
@VisibleForTesting public static void setNativeZlibLoaded(boolean isLoaded) Set the flag whether to use native library. Used for testing non-native libraries- Parameters:
isLoaded- isLoaded.
-
isNativeZlibLoaded
Check if native-zlib code is loaded & initialized correctly and can be loaded for this job.- Parameters:
conf- configuration- Returns:
trueif native-zlib is loaded & initialized and can be loaded for this job, elsefalse
-
getLibraryName
-
getZlibCompressorType
Return the appropriate type of the zlib compressor.- Parameters:
conf- configuration- Returns:
- the appropriate type of the zlib compressor.
-
getZlibCompressor
Return the appropriate implementation of the zlib compressor.- Parameters:
conf- configuration- Returns:
- the appropriate implementation of the zlib compressor.
-
getZlibDecompressorType
Return the appropriate type of the zlib decompressor.- Parameters:
conf- configuration- Returns:
- the appropriate type of the zlib decompressor.
-
getZlibDecompressor
Return the appropriate implementation of the zlib decompressor.- Parameters:
conf- configuration- Returns:
- the appropriate implementation of the zlib decompressor.
-
getZlibDirectDecompressor
Return the appropriate implementation of the zlib direct decompressor.- Parameters:
conf- configuration- Returns:
- the appropriate implementation of the zlib decompressor.
-
setCompressionStrategy
public static void setCompressionStrategy(Configuration conf, ZlibCompressor.CompressionStrategy strategy) -
getCompressionStrategy
-
setCompressionLevel
-
getCompressionLevel
-