org.apache.oozie.compression
Class CodecFactory

java.lang.Object
  extended by org.apache.oozie.compression.CodecFactory

public class CodecFactory
extends Object

Utility class for maintaining list of codecs and providing facility for compressing and decompressing.


Field Summary
static String COMPRESSION_CODECS
           
static String COMPRESSION_KEY_HEADER
           
static String COMPRESSION_MAGIC_DATA
           
static String COMPRESSION_OUTPUT_CODEC
           
static String UTF_8_ENCODING
           
 
Constructor Summary
CodecFactory()
           
 
Method Summary
static CompressionCodec getCompressionCodec()
          Get output compression codec
static CompressionCodec getDeCompressionCodec(DataInputStream dais)
          Get decompression codec after reading from stream
static byte[] getHeaderBytes()
          Get header bytes
static void initialize(org.apache.hadoop.conf.Configuration conf)
          Initialize the codec factory to maintain list of codecs
static boolean isCompressionEnabled()
          Check whether compression is enabled or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESSION_CODECS

public static final String COMPRESSION_CODECS
See Also:
Constant Field Values

COMPRESSION_OUTPUT_CODEC

public static final String COMPRESSION_OUTPUT_CODEC
See Also:
Constant Field Values

COMPRESSION_MAGIC_DATA

public static final String COMPRESSION_MAGIC_DATA
See Also:
Constant Field Values

COMPRESSION_KEY_HEADER

public static final String COMPRESSION_KEY_HEADER
See Also:
Constant Field Values

UTF_8_ENCODING

public static final String UTF_8_ENCODING
See Also:
Constant Field Values
Constructor Detail

CodecFactory

public CodecFactory()
Method Detail

initialize

public static void initialize(org.apache.hadoop.conf.Configuration conf)
                       throws Exception
Initialize the codec factory to maintain list of codecs

Parameters:
conf -
Throws:
Exception

isCompressionEnabled

public static boolean isCompressionEnabled()
Check whether compression is enabled or not

Returns:
true if compression is enabled

getDeCompressionCodec

public static CompressionCodec getDeCompressionCodec(DataInputStream dais)
                                              throws IOException
Get decompression codec after reading from stream

Parameters:
dais - the input stream
Returns:
the decompression codec
Throws:
IOException

getCompressionCodec

public static CompressionCodec getCompressionCodec()
Get output compression codec

Returns:
the compression codec

getHeaderBytes

public static byte[] getHeaderBytes()
Get header bytes

Returns:
the header bytes


Copyright © 2015 Apache Software Foundation. All Rights Reserved.