org.apache.hadoop.mapreduce.lib.join
Class JoinRecordReader<K extends org.apache.hadoop.io.WritableComparable<?>>

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<K,V>
      extended by org.apache.hadoop.mapreduce.lib.join.ComposableRecordReader<K,X>
          extended by org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader<K,org.apache.hadoop.io.Writable,TupleWritable>
              extended by org.apache.hadoop.mapreduce.lib.join.JoinRecordReader<K>
All Implemented Interfaces:
Closeable, Comparable<ComposableRecordReader<K,?>>, org.apache.hadoop.conf.Configurable
Direct Known Subclasses:
InnerJoinRecordReader, OuterJoinRecordReader

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class JoinRecordReader<K extends org.apache.hadoop.io.WritableComparable<?>>
extends CompositeRecordReader<K,org.apache.hadoop.io.Writable,TupleWritable>

Base class for Composite joins returning Tuples of arbitrary Writables.


Nested Class Summary
protected  class JoinRecordReader.JoinDelegationIterator
          Since the JoinCollector is effecting our operation, we need only provide an iterator proxy wrapping its operation.
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader
CompositeRecordReader.JoinCollector
 
Field Summary
 
Fields inherited from class org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader
conf, jc, key, keyclass, kids, value
 
Constructor Summary
JoinRecordReader(int id, org.apache.hadoop.conf.Configuration conf, int capacity, Class<? extends org.apache.hadoop.io.WritableComparator> cmpcl)
           
 
Method Summary
 TupleWritable createValue()
          Create instance of value.
protected  ResetableIterator<TupleWritable> getDelegate()
          Return an iterator wrapping the JoinCollector.
 boolean nextKeyValue()
          Emit the next set of key, value pairs as defined by the child RecordReaders and operation associated with this composite RR.
 
Methods inherited from class org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader
accept, add, close, combine, compareTo, createKey, createTupleWritable, fillJoinCollector, getComparator, getConf, getCurrentKey, getCurrentValue, getProgress, getRecordReaderQueue, hasNext, id, initialize, key, key, setConf, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoinRecordReader

public JoinRecordReader(int id,
                        org.apache.hadoop.conf.Configuration conf,
                        int capacity,
                        Class<? extends org.apache.hadoop.io.WritableComparator> cmpcl)
                 throws IOException
Throws:
IOException
Method Detail

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Emit the next set of key, value pairs as defined by the child RecordReaders and operation associated with this composite RR.

Specified by:
nextKeyValue in class RecordReader<K extends org.apache.hadoop.io.WritableComparable<?>,TupleWritable>
Returns:
true if a key/value pair was read
Throws:
IOException
InterruptedException

createValue

public TupleWritable createValue()
Description copied from class: ComposableRecordReader
Create instance of value.


getDelegate

protected ResetableIterator<TupleWritable> getDelegate()
Return an iterator wrapping the JoinCollector.

Specified by:
getDelegate in class CompositeRecordReader<K extends org.apache.hadoop.io.WritableComparable<?>,org.apache.hadoop.io.Writable,TupleWritable>


Copyright © 2012 Apache Software Foundation. All Rights Reserved.