public class KeyValueLineRecordReader extends java.lang.Object implements RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
| Constructor and Description |
|---|
KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration job,
FileSplit split) |
| Modifier and Type | Method and Description |
|---|---|
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) |
java.lang.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.
|
public KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration job,
FileSplit split)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Class getKeyClass()
public org.apache.hadoop.io.Text createKey()
RecordReadercreateKey in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>public org.apache.hadoop.io.Text createValue()
RecordReadercreateValue 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 java.io.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 intojava.io.IOExceptionpublic float getProgress()
RecordReaderRecordReader 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.public long getPos()
throws java.io.IOException
RecordReadergetPos in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>java.io.IOExceptionpublic void close()
throws java.io.IOException
RecordReaderInputSplit to future operations.close in interface RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>java.io.IOExceptionCopyright © 2009 The Apache Software Foundation