org.apache.hadoop.vertica
Class VerticaInputSplit

java.lang.Object
  extended by org.apache.hadoop.mapreduce.InputSplit
      extended by org.apache.hadoop.vertica.VerticaInputSplit
All Implemented Interfaces:
org.apache.hadoop.io.Writable

public class VerticaInputSplit
extends InputSplit
implements org.apache.hadoop.io.Writable

Input split class for reading data from Vertica


Constructor Summary
VerticaInputSplit()
          (@inheritDoc)
VerticaInputSplit(String inputQuery, List<Object> segmentParams, long start, long end)
          Set the input query and a list of parameters to substitute when evaluating the query
 
Method Summary
 void close()
          (@inheritDoc)
 void configure(org.apache.hadoop.conf.Configuration conf)
          (@inheritDoc)
 ResultSet executeQuery()
          Run the query that, when executed returns input for the mapper
 org.apache.hadoop.conf.Configuration getConfiguration()
          (@inheritDoc)
 long getEnd()
           
 long getLength()
          Get the size of the split, so that the input splits can be sorted by size.
 String[] getLocations()
          Get the list of nodes by name where the data for the split would be local.
 List<Object> getSegmentParams()
          Return the parameters used for input query
 long getStart()
           
 void readFields(DataInput in)
          
 void write(DataOutput out)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerticaInputSplit

public VerticaInputSplit()
(@inheritDoc)


VerticaInputSplit

public VerticaInputSplit(String inputQuery,
                         List<Object> segmentParams,
                         long start,
                         long end)
Set the input query and a list of parameters to substitute when evaluating the query

Parameters:
inputQuery - SQL query to run
segmentParams - list of parameters to substitute into the query
start - the logical starting record number
end - the logical ending record number
Method Detail

configure

public void configure(org.apache.hadoop.conf.Configuration conf)
               throws Exception
(@inheritDoc)

Throws:
Exception

getSegmentParams

public List<Object> getSegmentParams()
Return the parameters used for input query


executeQuery

public ResultSet executeQuery()
                       throws Exception
Run the query that, when executed returns input for the mapper

Throws:
Exception

close

public void close()
           throws SQLException
(@inheritDoc)

Throws:
SQLException

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 class: InputSplit
Get the size of the split, so that the input splits can be sorted by size.

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

getLocations

public String[] getLocations()
                      throws IOException
Get the list of nodes by name where the data for the split would be local. The locations do not need to be serialized.

Specified by:
getLocations in class InputSplit
Returns:
a new array of the node nodes.
Throws:
IOException

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
(@inheritDoc)


readFields

public void readFields(DataInput in)
                throws IOException

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException


Copyright © 2009 The Apache Software Foundation