org.apache.pig.backend.hadoop.executionengine.mapReduceLayer
Class PigSplit
java.lang.Object
org.apache.hadoop.mapreduce.InputSplit
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigSplit
- All Implemented Interfaces:
- org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.Writable
public class PigSplit
- extends org.apache.hadoop.mapreduce.InputSplit
- implements org.apache.hadoop.io.Writable, org.apache.hadoop.conf.Configurable
The main split class that maintains important
information about the input split.
The reason this class implements Configurable is so that Hadoop will call
Configurable.setConf(Configuration)
on the backend so we can use
the Configuration to create the SerializationFactory to deserialize the
wrapped InputSplit.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PigSplit
public PigSplit()
PigSplit
public PigSplit(org.apache.hadoop.mapreduce.InputSplit wrappedSplit,
int inputIndex,
List<OperatorKey> targetOps,
int splitIndex)
getTargetOps
public List<OperatorKey> getTargetOps()
getWrappedSplit
public org.apache.hadoop.mapreduce.InputSplit getWrappedSplit()
- This methods returns the actual InputSplit (as returned by the
InputFormat
) which this class is wrapping.
- Returns:
- the wrappedSplit
getLocations
public String[] getLocations()
throws IOException,
InterruptedException
- Specified by:
getLocations
in class org.apache.hadoop.mapreduce.InputSplit
- Throws:
IOException
InterruptedException
getLength
public long getLength()
throws IOException,
InterruptedException
- Specified by:
getLength
in class org.apache.hadoop.mapreduce.InputSplit
- Throws:
IOException
InterruptedException
readFields
public void readFields(DataInput is)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput os)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
getConf
public org.apache.hadoop.conf.Configuration getConf()
- Specified by:
getConf
in interface org.apache.hadoop.conf.Configurable
setConf
public void setConf(org.apache.hadoop.conf.Configuration conf)
- (non-Javadoc)
- Specified by:
setConf
in interface org.apache.hadoop.conf.Configurable
- See Also:
This will be called by
{@link PigInputFormat#getSplits(org.apache.hadoop.mapreduce.JobContext)}
to be used in {@link #write(DataOutput)} for serializing the
wrappedSplit
This will be called by Hadoop in the backend to set the right Job
Configuration (hadoop will invoke this method because PigSplit implements
{@link Configurable} - we need this Configuration in readFields() to
deserialize the wrappedSplit
Copyright © ${year} The Apache Software Foundation