AvroDatumConverter<K, ?> keyConverter = converterFactory.create(
(Class<K>) context.getOutputKeyClass());
AvroDatumConverter<V, ?> valueConverter = converterFactory.create(
(Class<V>) context.getOutputValueClass());
GenericData dataModel = AvroSerialization.createDataModel(conf);
return new AvroKeyValueRecordWriter<K, V>(keyConverter, valueConverter,
dataModel, getCompressionCodec(context), getAvroFileOutputStream(context),
getSyncInterval(context));
}