felix.thirdpart
Class XmlInputFormat.XmlRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
      extended by felix.thirdpart.XmlInputFormat.XmlRecordReader
All Implemented Interfaces:
java.io.Closeable
Enclosing class:
XmlInputFormat

public static class XmlInputFormat.XmlRecordReader
extends org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>

XMLRecordReader class to read through a given xml document to output xml blocks as records as specified by the start tag and end tag


Constructor Summary
XmlInputFormat.XmlRecordReader(org.apache.hadoop.mapreduce.lib.input.FileSplit split, org.apache.hadoop.conf.Configuration conf)
          The constructor.
 
Method Summary
 void close()
           
 org.apache.hadoop.io.LongWritable getCurrentKey()
          Returns current key.
 org.apache.hadoop.io.Text getCurrentValue()
          Returns current value.
 float getProgress()
          Returns progress through file.
 void initialize(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
           
 boolean nextKeyValue()
          Sets next key, value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlInputFormat.XmlRecordReader

public XmlInputFormat.XmlRecordReader(org.apache.hadoop.mapreduce.lib.input.FileSplit split,
                                      org.apache.hadoop.conf.Configuration conf)
                               throws java.io.IOException
The constructor.

Parameters:
split -
conf -
Throws:
java.io.IOException
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException

getProgress

public float getProgress()
                  throws java.io.IOException
Returns progress through file.

Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException

getCurrentKey

public org.apache.hadoop.io.LongWritable getCurrentKey()
                                                throws java.io.IOException,
                                                       java.lang.InterruptedException
Returns current key.

Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException
java.lang.InterruptedException

getCurrentValue

public org.apache.hadoop.io.Text getCurrentValue()
                                          throws java.io.IOException,
                                                 java.lang.InterruptedException
Returns current value.

Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException
java.lang.InterruptedException

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit split,
                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                throws java.io.IOException,
                       java.lang.InterruptedException
Specified by:
initialize in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException
java.lang.InterruptedException

nextKeyValue

public boolean nextKeyValue()
                     throws java.io.IOException,
                            java.lang.InterruptedException
Sets next key, value.

Specified by:
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
java.io.IOException
java.lang.InterruptedException