@InterfaceAudience.Public @InterfaceStability.Stable public interface RecordReader<K,V>
RecordReader
reads <key, value> pairs from an
InputSplit
.
RecordReader
, typically, converts the byte-oriented view of
the input, provided by the InputSplit
, and presents a
record-oriented view for the Mapper
and Reducer
tasks for
processing. It thus assumes the responsibility of processing record
boundaries and presenting the tasks with keys and values.
InputSplit
,
InputFormat
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this
InputSplit to future operations. |
K |
createKey()
Create an object of the appropriate type to be used as a key.
|
V |
createValue()
Create an object of the appropriate type to be used as a value.
|
long |
getPos()
Returns the current position in the input.
|
float |
getProgress()
How much of the input has the
RecordReader consumed i.e. |
boolean |
next(K key,
V value)
Reads the next key/value pair from the input for processing.
|
boolean next(K key, V value) throws IOException
key
- the key to read data intovalue
- the value to read data intoIOException
K createKey()
V createValue()
long getPos() throws IOException
IOException
void close() throws IOException
InputSplit
to future operations.IOException
float getProgress() throws IOException
RecordReader
consumed i.e.
has been processed by?0.0
to 1.0
.IOException
Copyright © 2016 Apache Software Foundation. All rights reserved.