public static class CSVInputFormat.CSVRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
OraLoaderMapper
. It produces an Object
for the key and a org.apache.avro.generic.IndexedRecord
for the value.Constructor and Description |
---|
CSVInputFormat.CSVRecordReader(org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> textRecordReader) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the record reader.
|
java.lang.Object |
getCurrentKey()
The key should be be an Object whose toString() method return value must help identify the
IndexedRecord returned by getCurrentValue() . |
org.apache.avro.generic.IndexedRecord |
getCurrentValue()
The next line of text is read from the input and split into tokens using the ',' delimiter.
|
float |
getProgress()
The current progress of the record reader through its data.
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
Called once at initialization.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
public CSVInputFormat.CSVRecordReader(org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> textRecordReader)
public org.apache.avro.generic.IndexedRecord getCurrentValue() throws java.io.IOException, java.lang.InterruptedException
IndexedRecord
which is returned as the key value.getCurrentValue
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
java.io.IOException
java.lang.InterruptedException
public java.lang.Object getCurrentKey() throws java.io.IOException, java.lang.InterruptedException
IndexedRecord
returned by getCurrentValue()
.
This implementation returns the actual Text
object that getCurrentValue()
tokenizes into an IndexedRecord
.
getCurrentKey
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
java.io.IOException
java.lang.InterruptedException
public void initialize(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws java.io.IOException, java.lang.InterruptedException
initialize
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
split
- the split that defines the range of records to readcontext
- the information about the taskjava.io.IOException
java.lang.InterruptedException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
java.io.IOException
public boolean nextKeyValue() throws java.io.IOException, java.lang.InterruptedException
nextKeyValue
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
java.io.IOException
java.lang.InterruptedException
public float getProgress() throws java.io.IOException, java.lang.InterruptedException
getProgress
in class org.apache.hadoop.mapreduce.RecordReader<java.lang.Object,org.apache.avro.generic.IndexedRecord>
java.io.IOException
java.lang.InterruptedException