org.apache.avro.mapreduce
Class AvroKeyRecordReader<T>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<K,V>
      extended by org.apache.avro.mapreduce.AvroRecordReaderBase<AvroKey<T>,org.apache.hadoop.io.NullWritable,T>
          extended by org.apache.avro.mapreduce.AvroKeyRecordReader<T>
Type Parameters:
T - The (java) type of data in Avro container file.
All Implemented Interfaces:
Closeable

public class AvroKeyRecordReader<T>
extends AvroRecordReaderBase<AvroKey<T>,org.apache.hadoop.io.NullWritable,T>

Reads records from an input split representing a chunk of an Avro container file.


Constructor Summary
AvroKeyRecordReader(org.apache.avro.Schema readerSchema)
          Constructor.
 
Method Summary
 AvroKey<T> getCurrentKey()
          
 org.apache.hadoop.io.NullWritable getCurrentValue()
          
 boolean nextKeyValue()
          
 
Methods inherited from class org.apache.avro.mapreduce.AvroRecordReaderBase
close, createAvroFileReader, createSeekableInput, getCurrentRecord, getProgress, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvroKeyRecordReader

public AvroKeyRecordReader(org.apache.avro.Schema readerSchema)
Constructor.

Parameters:
readerSchema - The reader schema to use for the records in the Avro container file.
Method Detail

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException

Overrides:
nextKeyValue in class AvroRecordReaderBase<AvroKey<T>,org.apache.hadoop.io.NullWritable,T>
Throws:
IOException
InterruptedException

getCurrentKey

public AvroKey<T> getCurrentKey()
                         throws IOException,
                                InterruptedException

Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<AvroKey<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException

getCurrentValue

public org.apache.hadoop.io.NullWritable getCurrentValue()
                                                  throws IOException,
                                                         InterruptedException

Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<AvroKey<T>,org.apache.hadoop.io.NullWritable>
Throws:
IOException
InterruptedException


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.