org.apache.pig.piggybank.storage.avro
Class PigAvroRecordReader
java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
org.apache.pig.piggybank.storage.avro.PigAvroRecordReader
- All Implemented Interfaces:
- Closeable
public class PigAvroRecordReader
- extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
This is an implementation of record reader which reads in avro data and
convert them into pairs.
Constructor Summary |
PigAvroRecordReader(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.lib.input.FileSplit split,
org.apache.avro.Schema schema)
constructor to initialize input and avro data reader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PigAvroRecordReader
public PigAvroRecordReader(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.mapreduce.lib.input.FileSplit split,
org.apache.avro.Schema schema)
throws IOException
- constructor to initialize input and avro data reader
- Throws:
IOException
getProgress
public float getProgress()
throws IOException
- Specified by:
getProgress
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
getPos
public long getPos()
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
getCurrentKey
public org.apache.hadoop.io.NullWritable getCurrentKey()
throws IOException,
InterruptedException
- Specified by:
getCurrentKey
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
getCurrentValue
public org.apache.hadoop.io.Writable getCurrentValue()
throws IOException,
InterruptedException
- Specified by:
getCurrentValue
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
wrapAsTuple
protected Tuple wrapAsTuple(Object in)
- Wrap non-tuple value as a tuple
initialize
public void initialize(org.apache.hadoop.mapreduce.InputSplit arg0,
org.apache.hadoop.mapreduce.TaskAttemptContext arg1)
throws IOException,
InterruptedException
- Specified by:
initialize
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
nextKeyValue
public boolean nextKeyValue()
throws IOException,
InterruptedException
- Specified by:
nextKeyValue
in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Writable>
- Throws:
IOException
InterruptedException
Copyright © ${year} The Apache Software Foundation