public class KeyValueLineRecordReader extends RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>
| Constructor and Description |
|---|
KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.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) |
public KeyValueLineRecordReader(org.apache.hadoop.conf.Configuration conf)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.Class<?> getKeyClass()
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws java.io.IOException
RecordReaderinitialize 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 taskjava.io.IOExceptionpublic 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 java.io.IOException
nextKeyValue in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>java.io.IOExceptionpublic org.apache.hadoop.io.Text getCurrentKey()
RecordReadergetCurrentKey in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>public org.apache.hadoop.io.Text getCurrentValue()
RecordReadergetCurrentValue in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>public float getProgress()
RecordReadergetProgress in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>public void close()
throws java.io.IOException
RecordReaderclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class RecordReader<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>java.io.IOExceptionCopyright © 2009 The Apache Software Foundation