Package org.apache.hadoop.mapred.join
Class OverrideRecordReader<K extends WritableComparable,V extends Writable>
java.lang.Object
org.apache.hadoop.mapred.join.CompositeRecordReader<K,V,V>
org.apache.hadoop.mapred.join.MultiFilterRecordReader<K,V>
org.apache.hadoop.mapred.join.OverrideRecordReader<K,V>
- All Implemented Interfaces:
Closeable,AutoCloseable,Comparable<ComposableRecordReader<K,,?>> Configurable,ComposableRecordReader<K,,V> RecordReader<K,V>
@Public
@Stable
public class OverrideRecordReader<K extends WritableComparable,V extends Writable>
extends MultiFilterRecordReader<K,V>
Prefer the "rightmost" data source for this key.
For example,
override(S1,S2,S3) will prefer values
from S3 over S2, and values from S2 over S1 for all keys
emitted from all sources.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.mapred.join.MultiFilterRecordReader
org.apache.hadoop.mapred.join.MultiFilterRecordReader.MultiFilterDelegationIterator -
Field Summary
Fields inherited from class org.apache.hadoop.mapred.join.CompositeRecordReader
jc, kids -
Method Summary
Modifier and TypeMethodDescriptionprotected Vemit(TupleWritable dst) Emit the value with the highest position in the tuple.protected voidfillJoinCollector(K iterkey) Instead of filling the JoinCollector with iterators from all data sources, fill only the rightmost for this key.Methods inherited from class org.apache.hadoop.mapred.join.MultiFilterRecordReader
combine, createValue, getDelegate, nextMethods inherited from class org.apache.hadoop.mapred.join.CompositeRecordReader
accept, add, close, compareTo, createInternalValue, createKey, getComparator, getConf, getPos, getProgress, getRecordReaderQueue, hasNext, id, key, key, setConf, skipMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.apache.hadoop.mapred.join.ComposableRecordReader
accept, hasNext, id, key, key, skipMethods inherited from interface org.apache.hadoop.mapred.RecordReader
close, createKey, getPos, getProgress
-
Method Details
-
emit
Emit the value with the highest position in the tuple.- Specified by:
emitin classMultiFilterRecordReader<K extends WritableComparable,V extends Writable>
-
fillJoinCollector
Instead of filling the JoinCollector with iterators from all data sources, fill only the rightmost for this key. This not only saves space by discarding the other sources, but it also emits the number of key-value pairs in the preferred RecordReader instead of repeating that stream n times, where n is the cardinality of the cross product of the discarded streams for the given key.- Overrides:
fillJoinCollectorin classCompositeRecordReader<K extends WritableComparable,V extends Writable, V extends Writable> - Throws:
IOException
-