org.apache.hadoop.mapreduce.lib.join
Class MultiFilterRecordReader<K extends WritableComparable<?>,V extends Writable>

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,V,V>
              extended by org.apache.hadoop.mapreduce.lib.join.MultiFilterRecordReader<K,V>
All Implemented Interfaces:
Closeable, Comparable<ComposableRecordReader<K,?>>, Configurable
Direct Known Subclasses:
OverrideRecordReader

@InterfaceAudience.Public
@InterfaceStability.Stable
public abstract class MultiFilterRecordReader<K extends WritableComparable<?>,V extends Writable>
extends CompositeRecordReader<K,V,V>

Base class for Composite join returning values derived from multiple sources, but generally not tuples.


Field Summary
 
Fields inherited from class org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader
conf, jc, key, keyclass, kids, value
 
Constructor Summary
MultiFilterRecordReader(int id, Configuration conf, int capacity, Class<? extends WritableComparator> cmpcl)
           
 
Method Summary
protected  boolean combine(Object[] srcs, TupleWritable dst)
          Default implementation offers emit(org.apache.hadoop.mapreduce.lib.join.TupleWritable) every Tuple from the collector (the outer join of child RRs).
protected abstract  V emit(TupleWritable dst)
          For each tuple emitted, return a value (typically one of the values in the tuple).
protected  ResetableIterator<V> getDelegate()
          Return an iterator returning a single value from the tuple.
 void initialize(InputSplit split, TaskAttemptContext context)
          Called once at initialization.
 boolean nextKeyValue()
          Read the next key, value pair.
 
Methods inherited from class org.apache.hadoop.mapreduce.lib.join.CompositeRecordReader
accept, add, close, compareTo, createKey, createTupleWritable, fillJoinCollector, getComparator, getConf, getCurrentKey, getCurrentValue, getProgress, getRecordReaderQueue, hasNext, id, key, key, setConf, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiFilterRecordReader

public MultiFilterRecordReader(int id,
                               Configuration conf,
                               int capacity,
                               Class<? extends WritableComparator> cmpcl)
                        throws IOException
Throws:
IOException
Method Detail

emit

protected abstract V emit(TupleWritable dst)
                                    throws IOException
For each tuple emitted, return a value (typically one of the values in the tuple). Modifying the Writables in the tuple is permitted and unlikely to affect join behavior in most cases, but it is not recommended. It's safer to clone first.

Throws:
IOException

combine

protected boolean combine(Object[] srcs,
                          TupleWritable dst)
Default implementation offers emit(org.apache.hadoop.mapreduce.lib.join.TupleWritable) every Tuple from the collector (the outer join of child RRs).

Specified by:
combine in class CompositeRecordReader<K extends WritableComparable<?>,V extends Writable,V extends Writable>

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Read the next key, value pair.

Specified by:
nextKeyValue in class RecordReader<K extends WritableComparable<?>,V extends Writable>
Returns:
true if a key/value pair was read
Throws:
IOException
InterruptedException

initialize

public void initialize(InputSplit split,
                       TaskAttemptContext context)
                throws IOException,
                       InterruptedException
Description copied from class: RecordReader
Called once at initialization.

Overrides:
initialize in class CompositeRecordReader<K extends WritableComparable<?>,V extends Writable,V extends Writable>
Parameters:
split - the split that defines the range of records to read
context - the information about the task
Throws:
IOException
InterruptedException

getDelegate

protected ResetableIterator<V> getDelegate()
Return an iterator returning a single value from the tuple.

Specified by:
getDelegate in class CompositeRecordReader<K extends WritableComparable<?>,V extends Writable,V extends Writable>
See Also:
MultiFilterRecordReader.MultiFilterDelegationIterator


Copyright © 2012 Apache Software Foundation. All Rights Reserved.