Package org.apache.hadoop.mapred.join
Class CompositeInputSplit
java.lang.Object
org.apache.hadoop.mapred.join.CompositeInputSplit
- All Implemented Interfaces:
Writable,InputSplit
This InputSplit contains a set of child InputSplits. Any InputSplit inserted
into this collection must have a public default constructor.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(InputSplit s) Add an InputSplit to this collection.get(int i) Get ith child InputSplit.longReturn the aggregate length of all child InputSplits currently added.longgetLength(int i) Get the length of ith child InputSplit.String[]getLocation(int i) getLocations from ith InputSplit.String[]Collect a set of hosts from all child InputSplits.voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidwrite(DataOutput out) Write splits in the following format.
-
Constructor Details
-
CompositeInputSplit
public CompositeInputSplit() -
CompositeInputSplit
public CompositeInputSplit(int capacity)
-
-
Method Details
-
add
Add an InputSplit to this collection.- Throws:
IOException- If capacity was not specified during construction or if capacity has been reached.
-
get
Get ith child InputSplit. -
getLength
Return the aggregate length of all child InputSplits currently added.- Specified by:
getLengthin interfaceInputSplit- Returns:
- the number of bytes in the input split.
- Throws:
IOException
-
getLength
Get the length of ith child InputSplit.- Throws:
IOException
-
getLocations
Collect a set of hosts from all child InputSplits.- Specified by:
getLocationsin interfaceInputSplit- Returns:
- list of hostnames where data of the
InputSplitis located as an array ofStrings. - Throws:
IOException
-
getLocation
getLocations from ith InputSplit.- Throws:
IOException
-
write
Write splits in the following format.<count><class1><class2>...<classn><split1><split2>...<splitn>- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
readFields
Deserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- If the child InputSplit cannot be read, typically for faliing access checks.
-