MR編寫之讀取linux上(指定目錄下的)配置文件

我首先把main函數和調用方式寫一下函數

/**
 *
 * @param args
 * 一、傳入參數
 * 二、傳出參數
 * 三、業務參數:①stg_log_  ②stg_log_class_perform_
 * 四、配置文件路徑:如xetl.properties
 */
public static void main(String[] args) {
    if (args.length < 2) {
        System.out.println("args must more than 2.");
        System.exit(0);
    }
    // day=(args[0].split("/"))[3];
    Configuration conf = new Configuration();
    FileSystem hdfs = null;
    try {
        int res = ToolRunner.run(conf, new AutoActLogParseMr(), args);
        System.exit(res);
    } catch (Exception e) {
        logger.error("", e);
    }
}
相關文章
相關標籤/搜索