package com.persagy.dmp.file.init;

import com.persagy.dmp.common.helper.SpringHelper;
import com.persagy.dmp.mybatis.dao.DbDao;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.net.InetAddress;

@Component
@Order(1)
@Slf4j
public class InitRunner implements CommandLineRunner {

    @Override
    public void run(String... args){
        log.warn("dmp-file应用初始化开始......");
        try {
            // 1.配置hdoop环境变量
            System.setProperty("HADOOP_USER_NAME", SpringHelper.getString("hadoop.user.name","hadoop"));
        } catch (Exception e) {
            log.error("dmp-file应用初始化失败",e);
        }
        log.warn("dmp-file应用初始化结束......");
    }

}
