@InterfaceAudience.Public @InterfaceStability.Stable public class KeyValueLineRecordReader extends RecordReader<Text,Text>
Modifier and Type | Field and Description |
---|---|
static String |
KEY_VALUE_SEPARATOR |
static String |
KEY_VALUE_SEPERATOR
Deprecated.
|
Constructor and Description |
---|
KeyValueLineRecordReader(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) |
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 static final String KEY_VALUE_SEPARATOR
@Deprecated public static final String KEY_VALUE_SEPERATOR
KEY_VALUE_SEPARATOR
public KeyValueLineRecordReader(Configuration conf) throws IOException
IOException
public Class getKeyClass()
public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException
RecordReader
initialize
in class RecordReader<Text,Text>
genericSplit
- the split that defines the range of records to readcontext
- the information about the taskIOException
public static int findSeparator(byte[] utf, int start, int length, byte sep)
public boolean nextKeyValue() throws IOException
nextKeyValue
in class RecordReader<Text,Text>
IOException
public Text getCurrentKey()
RecordReader
getCurrentKey
in class RecordReader<Text,Text>
public Text getCurrentValue()
RecordReader
getCurrentValue
in class RecordReader<Text,Text>
public float getProgress() throws IOException
RecordReader
getProgress
in class RecordReader<Text,Text>
IOException
public void close() throws IOException
RecordReader
close
in interface Closeable
close
in interface AutoCloseable
close
in class RecordReader<Text,Text>
IOException
Copyright © 2022 Apache Software Foundation. All rights reserved.