|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.KeyValueLineRecordReader
@InterfaceAudience.Public @InterfaceStability.Stable public class KeyValueLineRecordReader
This class treats a line in the input as a key/value pair separated by a separator character. The separator can be specified in config file under the attribute name mapreduce.input.keyvaluelinerecordreader.key.value.separator. The default separator is the tab character ('\t').
Constructor Summary | |
---|---|
KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration job,
FileSplit split)
|
Method Summary | |
---|---|
void |
close()
Close this InputSplit to future operations. |
org.apache.hadoop.io.Text |
createKey()
Create an object of the appropriate type to be used as a key. |
org.apache.hadoop.io.Text |
createValue()
Create an object of the appropriate type to be used as a value. |
static int |
findSeparator(byte[] utf,
int start,
int length,
byte sep)
|
Class |
getKeyClass()
|
long |
getPos()
Returns the current position in the input. |
float |
getProgress()
How much of the input has the RecordReader consumed i.e. |
boolean |
next(org.apache.hadoop.io.Text key,
org.apache.hadoop.io.Text value)
Read key/value pair in a line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration job, FileSplit split) throws IOException
IOException
Method Detail |
---|
public Class getKeyClass()
public org.apache.hadoop.io.Text createKey()
RecordReader
createKey
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
public org.apache.hadoop.io.Text createValue()
RecordReader
createValue
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
public static int findSeparator(byte[] utf, int start, int length, byte sep)
public boolean next(org.apache.hadoop.io.Text key, org.apache.hadoop.io.Text value) throws IOException
next
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
key
- the key to read data intovalue
- the value to read data into
IOException
public float getProgress() throws IOException
RecordReader
RecordReader
consumed i.e.
has been processed by?
getProgress
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
0.0
to 1.0
.
IOException
public long getPos() throws IOException
RecordReader
getPos
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
IOException
public void close() throws IOException
RecordReader
InputSplit
to future operations.
close
in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |