|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
org.apache.hadoop.mapreduce.lib.input.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').
| Field Summary | |
|---|---|
static String |
KEY_VALUE_SEPERATOR
|
| Constructor Summary | |
|---|---|
KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration conf)
|
|
| Method Summary | |
|---|---|
void |
close()
Close the record reader. |
static int |
findSeparator(byte[] utf,
int start,
int length,
byte sep)
|
org.apache.hadoop.io.Text |
getCurrentKey()
Get the current key |
org.apache.hadoop.io.Text |
getCurrentValue()
Get the current value. |
Class |
getKeyClass()
|
float |
getProgress()
The current progress of the record reader through its data. |
void |
initialize(InputSplit genericSplit,
TaskAttemptContext context)
Called once at initialization. |
boolean |
nextKeyValue()
Read key/value pair in a line. |
static void |
setKeyValue(org.apache.hadoop.io.Text key,
org.apache.hadoop.io.Text value,
byte[] line,
int lineLen,
int pos)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_VALUE_SEPERATOR
| Constructor Detail |
|---|
public KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration conf)
throws IOException
IOException| Method Detail |
|---|
public Class getKeyClass()
public void initialize(InputSplit genericSplit,
TaskAttemptContext context)
throws IOException
RecordReader
initialize in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>genericSplit - the split that defines the range of records to readcontext - the information about the task
IOException
public static int findSeparator(byte[] utf,
int start,
int length,
byte sep)
public static void setKeyValue(org.apache.hadoop.io.Text key,
org.apache.hadoop.io.Text value,
byte[] line,
int lineLen,
int pos)
public boolean nextKeyValue()
throws IOException
nextKeyValue in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>IOExceptionpublic org.apache.hadoop.io.Text getCurrentKey()
RecordReader
getCurrentKey in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>public org.apache.hadoop.io.Text getCurrentValue()
RecordReader
getCurrentValue in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
public float getProgress()
throws IOException
RecordReader
getProgress in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>IOException
public void close()
throws IOException
RecordReader
close in interface Closeableclose in class 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 | |||||||||