org.apache.hadoop.mapred.lib.db
Class DBInputFormat.DBInputSplit

java.lang.Object
  extended by org.apache.hadoop.mapred.lib.db.DBInputFormat.DBInputSplit
All Implemented Interfaces:
Writable, InputSplit
Enclosing class:
DBInputFormat<T extends DBWritable>

protected static class DBInputFormat.DBInputSplit
extends Object
implements InputSplit

A InputSplit that spans a set of rows


Constructor Summary
DBInputFormat.DBInputSplit()
          Default Constructor
DBInputFormat.DBInputSplit(long start, long end)
          Convenience Constructor
 
Method Summary
 long getEnd()
           
 long getLength()
          Get the total number of bytes in the data of the InputSplit.
 String[] getLocations()
          Get the list of hostnames where the input split is located.
 long getStart()
           
 void readFields(DataInput input)
          Deserialize the fields of this object from in.
 void write(DataOutput output)
          Serialize the fields of this object to out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBInputFormat.DBInputSplit

public DBInputFormat.DBInputSplit()
Default Constructor


DBInputFormat.DBInputSplit

public DBInputFormat.DBInputSplit(long start,
                                  long end)
Convenience Constructor

Parameters:
start - the index of the first row to select
end - the index of the last row to select
Method Detail

getLocations

public String[] getLocations()
                      throws IOException
Get the list of hostnames where the input split is located.

Specified by:
getLocations in interface InputSplit
Returns:
list of hostnames where data of the InputSplit is located as an array of Strings.
Throws:
IOException

getStart

public long getStart()
Returns:
The index of the first row to select

getEnd

public long getEnd()
Returns:
The index of the last row to select

getLength

public long getLength()
               throws IOException
Description copied from interface: InputSplit
Get the total number of bytes in the data of the InputSplit.

Specified by:
getLength in interface InputSplit
Returns:
The total row count in this split
Throws:
IOException

readFields

public void readFields(DataInput input)
                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:
input - DataInput to deseriablize this object from.
Throws:
IOException

write

public void write(DataOutput output)
           throws IOException
Serialize the fields of this object to out.

Specified by:
write in interface Writable
Parameters:
output - DataOuput to serialize this object into.
Throws:
IOException


Copyright © 2009 The Apache Software Foundation