Search in sources :

Example 1 with MultipleOutputs

use of org.apache.hadoop.mapred.lib.MultipleOutputs in project incubator-systemml by apache.

the class MRJobConfiguration method getMultipleConvertedOutputs.

public static CollectMultipleConvertedOutputs getMultipleConvertedOutputs(JobConf job) {
    byte[] resultIndexes = MRJobConfiguration.getResultIndexes(job);
    Converter[] outputConverters = new Converter[resultIndexes.length];
    MatrixCharacteristics[] stats = new MatrixCharacteristics[resultIndexes.length];
    HashMap<Byte, ArrayList<Integer>> tagMapping = new HashMap<Byte, ArrayList<Integer>>();
    for (int i = 0; i < resultIndexes.length; i++) {
        byte output = resultIndexes[i];
        ArrayList<Integer> vec = tagMapping.get(output);
        if (vec == null) {
            vec = new ArrayList<Integer>();
            tagMapping.put(output, vec);
        }
        vec.add(i);
        outputConverters[i] = getOuputConverter(job, i);
        stats[i] = MRJobConfiguration.getMatrixCharacteristicsForOutput(job, output);
    }
    MultipleOutputs multipleOutputs = new MultipleOutputs(job);
    return new CollectMultipleConvertedOutputs(outputConverters, stats, multipleOutputs);
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) MatrixCharacteristics(org.apache.sysml.runtime.matrix.MatrixCharacteristics) MultipleOutputs(org.apache.hadoop.mapred.lib.MultipleOutputs) IdenticalConverter(org.apache.sysml.runtime.matrix.data.IdenticalConverter) TextCellToRowBlockConverter(org.apache.sysml.runtime.matrix.data.TextCellToRowBlockConverter) BinaryCellToRowBlockConverter(org.apache.sysml.runtime.matrix.data.BinaryCellToRowBlockConverter) WeightedCellToSortInputConverter(org.apache.sysml.runtime.matrix.data.WeightedCellToSortInputConverter) TextToBinaryCellConverter(org.apache.sysml.runtime.matrix.data.TextToBinaryCellConverter) BinaryBlockToRowBlockConverter(org.apache.sysml.runtime.matrix.data.BinaryBlockToRowBlockConverter) Converter(org.apache.sysml.runtime.matrix.data.Converter) AddDummyWeightConverter(org.apache.sysml.runtime.matrix.data.AddDummyWeightConverter) BinaryBlockToBinaryCellConverter(org.apache.sysml.runtime.matrix.data.BinaryBlockToBinaryCellConverter) BinaryBlockToTextCellConverter(org.apache.sysml.runtime.matrix.data.BinaryBlockToTextCellConverter) BinaryCellToTextConverter(org.apache.sysml.runtime.matrix.data.BinaryCellToTextConverter)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 MultipleOutputs (org.apache.hadoop.mapred.lib.MultipleOutputs)1 MatrixCharacteristics (org.apache.sysml.runtime.matrix.MatrixCharacteristics)1 AddDummyWeightConverter (org.apache.sysml.runtime.matrix.data.AddDummyWeightConverter)1 BinaryBlockToBinaryCellConverter (org.apache.sysml.runtime.matrix.data.BinaryBlockToBinaryCellConverter)1 BinaryBlockToRowBlockConverter (org.apache.sysml.runtime.matrix.data.BinaryBlockToRowBlockConverter)1 BinaryBlockToTextCellConverter (org.apache.sysml.runtime.matrix.data.BinaryBlockToTextCellConverter)1 BinaryCellToRowBlockConverter (org.apache.sysml.runtime.matrix.data.BinaryCellToRowBlockConverter)1 BinaryCellToTextConverter (org.apache.sysml.runtime.matrix.data.BinaryCellToTextConverter)1 Converter (org.apache.sysml.runtime.matrix.data.Converter)1 IdenticalConverter (org.apache.sysml.runtime.matrix.data.IdenticalConverter)1 TextCellToRowBlockConverter (org.apache.sysml.runtime.matrix.data.TextCellToRowBlockConverter)1 TextToBinaryCellConverter (org.apache.sysml.runtime.matrix.data.TextToBinaryCellConverter)1 WeightedCellToSortInputConverter (org.apache.sysml.runtime.matrix.data.WeightedCellToSortInputConverter)1