public static class XMLInputFormat.XMLRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
RecordReader for XML documents (org.apache.hadoop.mapreduce API). Recognizes begin-of-document and end-of-document tags only:
everything between those delimiting tags is returned in a Text object.| Constructor and Description |
|---|
XMLInputFormat.XMLRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the record reader.
|
org.apache.hadoop.io.LongWritable |
getCurrentKey()
Returns the current key.
|
org.apache.hadoop.io.Text |
getCurrentValue()
Returns the current value.
|
float |
getProgress()
The current progress of the record reader through its data.
|
void |
initialize(org.apache.hadoop.mapreduce.InputSplit input,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Called once at initialization.
|
boolean |
nextKeyValue()
Read the next key, value pair.
|
public void initialize(org.apache.hadoop.mapreduce.InputSplit input,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
throws IOException,
InterruptedException
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>input - the split that defines the range of records to readcontext - the information about the taskIOExceptionInterruptedExceptionpublic boolean nextKeyValue()
throws IOException,
InterruptedException
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>true if a key/value pair was readIOExceptionInterruptedExceptionpublic org.apache.hadoop.io.LongWritable getCurrentKey()
throws IOException,
InterruptedException
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>null if there is no current keyIOExceptionInterruptedExceptionpublic org.apache.hadoop.io.Text getCurrentValue()
throws IOException,
InterruptedException
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>IOExceptionInterruptedExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>IOExceptionpublic float getProgress()
throws IOException
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>IOExceptionInterruptedExceptionCopyright © 2015. All rights reserved.