T - The Java type of the Avro data to write.public class AvroKeyWithMetadataRecordWriter<T>
extends org.apache.hadoop.mapreduce.RecordWriter<org.apache.avro.mapred.AvroKey<T>,org.apache.hadoop.io.NullWritable>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TEXT_PREFIX
The configuration key prefix for a text output metadata.
|
| Constructor and Description |
|---|
AvroKeyWithMetadataRecordWriter(org.apache.avro.Schema writerSchema,
org.apache.avro.file.CodecFactory compressionCodec,
java.io.OutputStream outputStream,
org.apache.hadoop.conf.Configuration conf)
Constructor.
|
public static final java.lang.String TEXT_PREFIX
public AvroKeyWithMetadataRecordWriter(org.apache.avro.Schema writerSchema,
org.apache.avro.file.CodecFactory compressionCodec,
java.io.OutputStream outputStream,
org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
writerSchema - The writer schema for the records in the Avro container file.compressionCodec - A compression codec factory for the Avro container file.outputStream - The output stream to write the Avro container file to.conf - the configurationjava.io.IOException - If the record writer cannot be opened.public void write(org.apache.avro.mapred.AvroKey<T> record, org.apache.hadoop.io.NullWritable ignore) throws java.io.IOException
write in class org.apache.hadoop.mapreduce.RecordWriter<org.apache.avro.mapred.AvroKey<T>,org.apache.hadoop.io.NullWritable>java.io.IOExceptionpublic void close(org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws java.io.IOException
close in class org.apache.hadoop.mapreduce.RecordWriter<org.apache.avro.mapred.AvroKey<T>,org.apache.hadoop.io.NullWritable>java.io.IOException