@InterfaceAudience.Public @InterfaceStability.Stable public class KeyValueLineRecordReader extends RecordReader<Text,Text>
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
KEY_VALUE_SEPERATOR |
| 构造器和说明 |
|---|
KeyValueLineRecordReader(Configuration conf) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close the record reader.
|
static int |
findSeparator(byte[] utf,
int start,
int length,
byte sep) |
Text |
getCurrentKey()
Get the current key
|
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(Text key,
Text value,
byte[] line,
int lineLen,
int pos) |
public KeyValueLineRecordReader(Configuration conf) throws IOException
IOExceptionpublic Class getKeyClass()
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException
RecordReaderinitialize 在类中 RecordReader<Text,Text>genericSplit - the split that defines the range of records to readcontext - the information about the taskIOExceptionpublic static int findSeparator(byte[] utf,
int start,
int length,
byte sep)
public boolean nextKeyValue()
throws IOException
nextKeyValue 在类中 RecordReader<Text,Text>IOExceptionpublic Text getCurrentKey()
RecordReadergetCurrentKey 在类中 RecordReader<Text,Text>public Text getCurrentValue()
RecordReadergetCurrentValue 在类中 RecordReader<Text,Text>public float getProgress()
throws IOException
RecordReadergetProgress 在类中 RecordReader<Text,Text>IOExceptionpublic void close()
throws IOException
RecordReaderclose 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 RecordReader<Text,Text>IOExceptionCopyright © 2009 The Apache Software Foundation