org.apache.pig.piggybank.storage
Class XMLLoader.XMLRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
      extended by org.apache.pig.piggybank.storage.XMLLoader.XMLRecordReader
All Implemented Interfaces:
Closeable
Enclosing class:
XMLLoader

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

Use this record reader to read XML tags out of a text file. It matches only the tags identified by an identifier configured through a call to setXMLIdentifier(String). It there are nesting tags of the given identifier, only the top level one is returned which also includes all enclosed tags.


Field Summary
protected  org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> wrapped
           
 
Constructor Summary
XMLLoader.XMLRecordReader(org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> wrapped)
           
 
Method Summary
 void close()
           
 boolean equals(Object obj)
           
 org.apache.hadoop.io.LongWritable getCurrentKey()
           
 org.apache.hadoop.io.Text getCurrentValue()
           
 float getProgress()
           
 int hashCode()
           
 void initialize(org.apache.hadoop.mapreduce.InputSplit split, org.apache.hadoop.mapreduce.TaskAttemptContext context)
          Delegate the initialization method to the wrapped stream after changing the length of the split to be non-ending.
 boolean nextKeyValue()
           
 void setXMLIdentifier(String identifier)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

wrapped

protected final org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> wrapped
Constructor Detail

XMLLoader.XMLRecordReader

public XMLLoader.XMLRecordReader(org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text> wrapped)
Method Detail

initialize

public void initialize(org.apache.hadoop.mapreduce.InputSplit split,
                       org.apache.hadoop.mapreduce.TaskAttemptContext context)
                throws IOException,
                       InterruptedException
Delegate the initialization method to the wrapped stream after changing the length of the split to be non-ending.

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

setXMLIdentifier

public void setXMLIdentifier(String identifier)

close

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getCurrentKey

public org.apache.hadoop.io.LongWritable getCurrentKey()
                                                throws IOException,
                                                       InterruptedException
Specified by:
getCurrentKey in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

getCurrentValue

public org.apache.hadoop.io.Text getCurrentValue()
                                          throws IOException,
                                                 InterruptedException
Specified by:
getCurrentValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

getProgress

public float getProgress()
                  throws IOException,
                         InterruptedException
Specified by:
getProgress in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Specified by:
nextKeyValue in class org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.LongWritable,org.apache.hadoop.io.Text>
Throws:
IOException
InterruptedException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012 The Apache Software Foundation