Search in sources :

Example 1 with TfUtils

use of org.apache.sysml.runtime.transform.TfUtils in project incubator-systemml by apache.

the class CSVAssignRowIDMapper method configure.

@Override
@SuppressWarnings("deprecation")
public void configure(JobConf job) {
    byte thisIndex;
    try {
        //it doesn't make sense to have repeated file names in the input, since this is for reblock
        thisIndex = MRJobConfiguration.getInputMatrixIndexesInMapper(job).get(0);
        outKey.set(thisIndex);
        Path thisPath = new Path(job.get(MRConfigurationNames.MR_MAP_INPUT_FILE));
        FileSystem fs = IOUtilFunctions.getFileSystem(thisPath, job);
        thisPath = thisPath.makeQualified(fs);
        filename = thisPath.toString();
        String[] strs = job.getStrings(CSVReblockMR.SMALLEST_FILE_NAME_PER_INPUT);
        Path headerPath = new Path(strs[thisIndex]).makeQualified(fs);
        headerFile = headerPath.toString().equals(filename);
        CSVReblockInstruction[] reblockInstructions = MRJobConfiguration.getCSVReblockInstructions(job);
        for (CSVReblockInstruction ins : reblockInstructions) if (ins.input == thisIndex) {
            delim = Pattern.quote(ins.delim);
            ignoreFirstLine = ins.hasHeader;
            break;
        }
        // load properties relevant to transform
        boolean omit = job.getBoolean(MRJobConfiguration.TF_TRANSFORM, false);
        if (omit)
            _agents = new TfUtils(job, true);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : Path(org.apache.hadoop.fs.Path) TfUtils(org.apache.sysml.runtime.transform.TfUtils) FileSystem(org.apache.hadoop.fs.FileSystem) CSVReblockInstruction(org.apache.sysml.runtime.instructions.mr.CSVReblockInstruction) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 CSVReblockInstruction (org.apache.sysml.runtime.instructions.mr.CSVReblockInstruction)1 TfUtils (org.apache.sysml.runtime.transform.TfUtils)1