org.apache.hadoop.mapred.join

## Class MultiFilterRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>

- java.lang.Object
- - org.apache.hadoop.mapred.join.CompositeRecordReader<K,V,V>
  - - org.apache.hadoop.mapred.join.MultiFilterRecordReader<K,V>

- All Implemented Interfaces:
    Closeable, AutoCloseable, Comparable<ComposableRecordReader<K,?>>, org.apache.hadoop.conf.Configurable, ComposableRecordReader<K,V>, RecordReader<K,V>
  Direct Known Subclasses:
    OverrideRecordReader

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public abstract class MultiFilterRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>
      extends CompositeRecordReader<K,V,V>
      implements ComposableRecordReader<K,V>

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `MultiFilterRecordReader.MultiFilterDelegationIterator` Proxy the JoinCollector, but include callback to emit.

  - ### Field Summary

    - ### Fields inherited from class org.apache.hadoop.mapred.join.CompositeRecordReader

      `jc, kids`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiFilterRecordReader(int id, JobConf conf, int capacity, Class<? extends org.apache.hadoop.io.WritableComparator> cmpcl)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `combine(Object[] srcs, TupleWritable dst)` Default implementation offers `emit(org.apache.hadoop.mapred.join.TupleWritable)` every Tuple from the collector (the outer join of child RRs).
    `V` | `createValue()` Create an object of the appropriate type to be used as a value.
    `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.
    `boolean` | `next(K key, V value)` Reads the next key/value pair from the input for processing.

    - ### Methods inherited from class org.apache.hadoop.mapred.join.CompositeRecordReader

      `accept, add, close, compareTo, createInternalValue, createKey, fillJoinCollector, getComparator, getConf, getPos, 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`

    - ### Methods inherited from interface org.apache.hadoop.mapred.join.ComposableRecordReader

      `accept, hasNext, id, key, key, skip`

    - ### Methods inherited from interface org.apache.hadoop.mapred.RecordReader

      `close, createKey, getPos, getProgress`

    - ### Methods inherited from interface java.lang.Comparable

      `compareTo`

- - ### Constructor Detail

    - #### MultiFilterRecordReader

          public MultiFilterRecordReader(int id,
                                         JobConf conf,
                                         int capacity,
                                         Class<? extends org.apache.hadoop.io.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.mapred.join.TupleWritable)` every Tuple from the collector (the outer join of child RRs).
      Specified by:
        `combine` in class `CompositeRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable>`

    - #### next

          public boolean next(K key,
                              V value)
                       throws IOException

      Reads the next key/value pair from the input for processing.
      Specified by:
        `next` in interface `RecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>`
      Parameters:
        `key` - the key to read data into
        `value` - the value to read data into
      Returns:
        true iff a key/value was read, false if at EOF
      Throws:
        `IOException`

    - #### createValue

          public V createValue()

      Create an object of the appropriate type to be used as a value.
      Specified by:
        `createValue` in interface `RecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable>`
      Returns:
        a new value object.

    - #### getDelegate

          protected ResetableIterator<V> getDelegate()

      Return an iterator returning a single value from the tuple.
      Specified by:
        `getDelegate` in class `CompositeRecordReader<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable>`
      See Also:
        `MultiFilterRecordReader.MultiFilterDelegationIterator`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.