Search in sources :

Example 1 with KeyValueTextInputFormat

use of org.apache.hadoop.mapred.KeyValueTextInputFormat in project apex-malhar by apache.

the class MapOperator method getSplits.

private InputSplit[] getSplits(JobConf conf, int numSplits, String path) throws Exception {
    FileInputFormat.setInputPaths(conf, new Path(path));
    if (inputFormat == null) {
        inputFormat = inputFormatClass.newInstance();
        String inputFormatClassName = inputFormatClass.getName();
        if (inputFormatClassName.equals("org.apache.hadoop.mapred.TextInputFormat")) {
            ((TextInputFormat) inputFormat).configure(conf);
        } else if (inputFormatClassName.equals("org.apache.hadoop.mapred.KeyValueTextInputFormat")) {
            ((KeyValueTextInputFormat) inputFormat).configure(conf);
        }
    }
    return inputFormat.getSplits(conf, numSplits);
// return null;
}
Also used : Path(org.apache.hadoop.fs.Path) TextInputFormat(org.apache.hadoop.mapred.TextInputFormat) KeyValueTextInputFormat(org.apache.hadoop.mapred.KeyValueTextInputFormat)

Aggregations

Path (org.apache.hadoop.fs.Path)1 KeyValueTextInputFormat (org.apache.hadoop.mapred.KeyValueTextInputFormat)1 TextInputFormat (org.apache.hadoop.mapred.TextInputFormat)1