|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.RecordReader<K,V>
org.apache.avro.mapreduce.AvroRecordReaderBase<K,V,T>
K - The type of key the record reader should generate.V - The type of value the record reader should generate.T - The type of the entries within the Avro container file being read.public abstract class AvroRecordReaderBase<K,V,T>
Abstract base class for RecordReaders that read Avro container files.
| Constructor Summary | |
|---|---|
protected |
AvroRecordReaderBase(org.apache.avro.Schema readerSchema)
Constructor. |
| Method Summary | |
|---|---|
void |
close()
|
protected org.apache.avro.file.DataFileReader<T> |
createAvroFileReader(org.apache.avro.file.SeekableInput input,
org.apache.avro.io.DatumReader<T> datumReader)
Creates an Avro container file reader from a seekable input stream. |
protected org.apache.avro.file.SeekableInput |
createSeekableInput(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path path)
Creates a seekable input stream to an Avro container file. |
protected T |
getCurrentRecord()
Gets the current record read from the Avro container file. |
float |
getProgress()
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
|
boolean |
nextKeyValue()
|
| Methods inherited from class org.apache.hadoop.mapreduce.RecordReader |
|---|
getCurrentKey, getCurrentValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AvroRecordReaderBase(org.apache.avro.Schema readerSchema)
readerSchema - The reader schema for the records of the Avro container file.| Method Detail |
|---|
public void initialize(org.apache.hadoop.mapreduce.InputSplit inputSplit,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws IOException,
InterruptedException
initialize in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOException
InterruptedException
public boolean nextKeyValue()
throws IOException,
InterruptedException
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOException
InterruptedException
public float getProgress()
throws IOException,
InterruptedException
getProgress in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOException
InterruptedException
public void close()
throws IOException
close in interface Closeableclose in class org.apache.hadoop.mapreduce.RecordReader<K,V>IOExceptionprotected T getCurrentRecord()
Calling nextKeyValue() moves this to the next record.
protected org.apache.avro.file.SeekableInput createSeekableInput(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.Path path)
throws IOException
conf - The hadoop configuration.path - The path to the avro container file.
IOException - If there is an error reading from the path.
protected org.apache.avro.file.DataFileReader<T> createAvroFileReader(org.apache.avro.file.SeekableInput input,
org.apache.avro.io.DatumReader<T> datumReader)
throws IOException
input - The input containing the Avro container file.datumReader - The reader to use for the individual records in the Avro container file.
IOException - If there is an error reading from the input stream.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||