com.datasalt.pangool.tuplemr.mapred.lib.input
Class FileSplit

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputSplit
      extended by com.datasalt.pangool.tuplemr.mapred.lib.input.FileSplit
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class FileSplit
extends org.apache.hadoop.mapreduce.InputSplit
implements org.apache.hadoop.io.Writable

A section of an input file. Returned by InputFormat.getSplits(JobContext) and passed to InputFormat.createRecordReader(InputSplit,TaskAttemptContext).


Constructor Summary
FileSplit(org.apache.hadoop.fs.Path file, long start, long length, String[] hosts)
          Constructs a split with host information
 
Method Summary
 long getLength()
          The number of bytes in the file to process.
 String[] getLocations()
           
 org.apache.hadoop.fs.Path getPath()
          The file containing this split's data.
 long getStart()
          The position of the first byte in the file to process.
 void readFields(DataInput in)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSplit

public FileSplit(org.apache.hadoop.fs.Path file,
                 long start,
                 long length,
                 String[] hosts)
Constructs a split with host information

Parameters:
file - the file name
start - the position of the first byte in the file to process
length - the number of bytes in the file to process
hosts - the list of hosts containing the block, possibly null
Method Detail

getPath

public org.apache.hadoop.fs.Path getPath()
The file containing this split's data.


getStart

public long getStart()
The position of the first byte in the file to process.


getLength

public long getLength()
The number of bytes in the file to process.

Specified by:
getLength in class org.apache.hadoop.mapreduce.InputSplit

toString

public String toString()
Overrides:
toString in class Object

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

getLocations

public String[] getLocations()
                      throws IOException
Specified by:
getLocations in class org.apache.hadoop.mapreduce.InputSplit
Throws:
IOException


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.