package com.artezzyan.technology.module;

import org.apache.hadoop.util.ToolRunner;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * Main Module
 *
 * @author yan.guo
 * @version 1.0
 */
public class MainModule {

    private final static Logger _logger = LogManager.getLogger(MainModule.class);

    public static void main(String[] args) {
        _logger.info("Start MapReduce Now... ");
        int exitCode = -1;

        try {
            exitCode = ToolRunner.run(new DriverModule(), args);
        } catch (Exception exception) {
            _logger.error("An error has occurred while running MapReduce! ", exception);
        } finally {
            _logger.info("End MapReduce Now.... ");
            // exit
            System.exit(exitCode);
        }
    }
}
