Class HadoopCodecFactory

java.lang.Object
org.apache.avro.hadoop.file.HadoopCodecFactory

public class HadoopCodecFactory extends Object
Encapsulates the ability to specify and configure an avro compression codec from a given hadoop codec defined with the configuration parameter: mapred.output.compression.codec Currently there are three codecs registered by default:
  • org.apache.hadoop.io.compress.DeflateCodec will map to deflate
  • org.apache.hadoop.io.compress.SnappyCodec will map to snappy
  • org.apache.hadoop.io.compress.BZip2Codec will map to bzip2
  • org.apache.hadoop.io.compress.GZipCodec will map to deflate
  • org.apache.hadoop.io.compress.ZStandardCodec will map to zstandard
  • Constructor Details

    • HadoopCodecFactory

      public HadoopCodecFactory()
  • Method Details

    • fromHadoopString

      public static CodecFactory fromHadoopString(String hadoopCodecClass)
      Maps a hadoop codec name into a CodecFactory. Currently there are four hadoop codecs registered:
      • org.apache.hadoop.io.compress.DeflateCodec will map to deflate
      • org.apache.hadoop.io.compress.SnappyCodec will map to snappy
      • org.apache.hadoop.io.compress.BZip2Codec will map to bzip2
      • org.apache.hadoop.io.compress.GZipCodec will map to deflate
      • org.apache.hadoop.io.compress.ZStandardCodec will map to zstandard
    • getAvroCodecName

      public static String getAvroCodecName(String hadoopCodecClass)