@Override
  void init(
      MRTaskReporter mrReporter, Map<String, LogicalInput> inputs,
      Map<String, LogicalOutput> outputs) throws Exception {
    // TODO HIVE-14042. Abort handling.
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.TEZ_INIT_OPERATORS);
    super.init(mrReporter, inputs, outputs);
    execContext = new ExecMapperContext(jconf);

    //Update JobConf using MRInput, info like filename comes via this
    mrInput = getMRInput(inputs);
    Configuration updatedConf = mrInput.getConfigUpdates();
    if (updatedConf != null) {
      for (Map.Entry<String, String> entry : updatedConf) {
        jconf.set(entry.getKey(), entry.getValue());
      }
    }
    createOutputMap();
    // Start all the Outputs.
    for (Map.Entry<String, LogicalOutput> outputEntry : outputs.entrySet()) {
      outputEntry.getValue().start();
      ((TezProcessor.TezKVOutputCollector) outMap.get(outputEntry.getKey()))
          .initialize();
    }

    String queryId = HiveConf.getVar(jconf, HiveConf.ConfVars.HIVE_QUERY_ID);
    cache = ObjectCacheFactory.getCache(jconf, queryId, true);

    try {
      execContext.setJc(jconf);

      cacheKey = MAP_PLAN_KEY;

      MapWork mapWork = (MapWork) cache.retrieve(cacheKey, new Callable<Object>() {
        @Override
        public Object call() {
          return Utilities.getMapWork(jconf);
        }
      });
      Utilities.setMapWork(jconf, mapWork);

      if (mapWork instanceof MergeFileWork) {
        mfWork = (MergeFileWork) mapWork;
      } else {
        throw new RuntimeException("MapWork should be an instance of MergeFileWork.");
      }

      String alias = mfWork.getAliasToWork().keySet().iterator().next();
      mergeOp = mfWork.getAliasToWork().get(alias);
      LOG.info(mergeOp.dump(0));

      MapredContext.init(true, new JobConf(jconf));
      ((TezContext) MapredContext.get()).setInputs(inputs);
      mergeOp.passExecContext(execContext);
      mergeOp.initializeLocalWork(jconf);
      mergeOp.initialize(jconf, null);

      OperatorUtils.setChildrenCollector(mergeOp.getChildOperators(), outMap);
      mergeOp.setReporter(reporter);
      MapredContext.get().setReporter(reporter);
    } catch (Throwable e) {
      if (e instanceof OutOfMemoryError) {
        // will this be true here?
        // Don't create a new object if we are already out of memory
        throw (OutOfMemoryError) e;
      } else if (e instanceof InterruptedException) {
        LOG.info("Hit an interrupt while initializing MergeFileRecordProcessor. Message={}",
            e.getMessage());
        throw (InterruptedException) e;
      } else {
        throw new RuntimeException("Map operator initialization failed", e);
      }
    }
    perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.TEZ_INIT_OPERATORS);
  }
Record processor for fast merging of files.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/MergeFileRecordProcessor.java