Class CompositeInputSplit

java.lang.Object
org.apache.hadoop.mapred.join.CompositeInputSplit
All Implemented Interfaces:
Writable, InputSplit

@Public @Stable public class CompositeInputSplit extends Object implements InputSplit
This InputSplit contains a set of child InputSplits. Any InputSplit inserted into this collection must have a public default constructor.
  • Constructor Details

    • CompositeInputSplit

      public CompositeInputSplit()
    • CompositeInputSplit

      public CompositeInputSplit(int capacity)
  • Method Details

    • add

      public void add(InputSplit s) throws IOException
      Add an InputSplit to this collection.
      Throws:
      IOException - If capacity was not specified during construction or if capacity has been reached.
    • get

      public InputSplit get(int i)
      Get ith child InputSplit.
    • getLength

      public long getLength() throws IOException
      Return the aggregate length of all child InputSplits currently added.
      Specified by:
      getLength in interface InputSplit
      Returns:
      the number of bytes in the input split.
      Throws:
      IOException
    • getLength

      public long getLength(int i) throws IOException
      Get the length of ith child InputSplit.
      Throws:
      IOException
    • getLocations

      public String[] getLocations() throws IOException
      Collect a set of hosts from all child InputSplits.
      Specified by:
      getLocations in interface InputSplit
      Returns:
      list of hostnames where data of the InputSplit is located as an array of Strings.
      Throws:
      IOException
    • getLocation

      public String[] getLocation(int i) throws IOException
      getLocations from ith InputSplit.
      Throws:
      IOException
    • write

      public void write(DataOutput out) throws IOException
      Write splits in the following format. <count><class1><class2>...<classn><split1><split2>...<splitn>
      Specified by:
      write in interface Writable
      Parameters:
      out - DataOuput to serialize this object into.
      Throws:
      IOException - any other problem for write.
    • readFields

      public void readFields(DataInput in) throws IOException
      Deserialize the fields of this object from in.

      For efficiency, implementations should attempt to re-use storage in the existing object where possible.

      Specified by:
      readFields in interface Writable
      Parameters:
      in - DataInput to deseriablize this object from.
      Throws:
      IOException - If the child InputSplit cannot be read, typically for faliing access checks.