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);
}
Aggregations