public void ensureOutputInitialize(OutputCollector output, Reporter reporter) { if (oc == null) { oc = output; rp = reporter; OperatorUtils.setChildrenCollector(mo.getChildOperators(), output); mo.setReporter(rp); MapredContext.get().setReporter(reporter); } }
@Override public void processRow(Object key, Object value) throws IOException { if (!anyRow) { OperatorUtils.setChildrenCollector(mo.getChildOperators(), oc); anyRow = true; } // reset the execContext for each new row execContext.resetRow(); try { // Since there is no concept of a group, we don't invoke // startGroup/endGroup for a mapper mo.process((Writable) value); incrementRowNumber(); } catch (Throwable e) { abort = true; Utilities.setMapWork(jc, null); if (e instanceof OutOfMemoryError) { // Don't create a new object if we are already out of memory throw (OutOfMemoryError) e; } else { String msg = "Error processing row: " + e; LOG.error(msg, e); throw new RuntimeException(msg, e); } } }
oc = output; rp = reporter; OperatorUtils.setChildrenCollector(mo.getChildOperators(), output); mo.setReporter(rp); MapredContext.get().setReporter(reporter);
l4j.info("Memory available for operators set to {}", LlapUtil.humanReadableByteCount(memoryAvailableToTask)); OperatorUtils.setMemoryAvailable(mapOp.getChildOperators(), memoryAvailableToTask); OperatorUtils.setChildrenCollector(mapOp.getChildOperators(), outMap); mapOp.setReporter(reporter); MapredContext.get().setReporter(reporter);
l4j.info("Memory available for operators set to {}", LlapUtil.humanReadableByteCount(memoryAvailableToTask)); OperatorUtils.setMemoryAvailable(mapOp.getChildOperators(), memoryAvailableToTask); OperatorUtils.setChildrenCollector(mapOp.getChildOperators(), outMap); mapOp.setReporter(reporter); MapredContext.get().setReporter(reporter);
mo.initializeMapOperator(jc); OperatorUtils.setChildrenCollector(mo.getChildOperators(), output); mo.setReporter(rp);