Example usage for org.apache.hadoop.mapreduce.lib.db DBConfiguration getInputClass

List of usage examples for org.apache.hadoop.mapreduce.lib.db DBConfiguration getInputClass

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce.lib.db DBConfiguration getInputClass.

Prototype

public Class<?> getInputClass() 

Source Link

Usage

From source file:com.cloudera.sqoop.mapreduce.db.OracleDataDrivenDBInputFormat.java

License:Apache License

@Override
protected RecordReader<LongWritable, T> createDBRecordReader(DBInputSplit split, Configuration conf)
        throws IOException {

    DBConfiguration dbConf = getDBConf();
    @SuppressWarnings("unchecked")
    Class<T> inputClass = (Class<T>) (dbConf.getInputClass());

    try {//from   w  w  w. ja  v a 2  s  .  co  m
        // Use Oracle-specific db reader
        return new OracleDataDrivenDBRecordReader<T>(split, inputClass, conf, getConnection(), dbConf,
                dbConf.getInputConditions(), dbConf.getInputFieldNames(), dbConf.getInputTableName());
    } catch (SQLException ex) {
        throw new IOException(ex.getMessage());
    }
}