package com.liangjian.dataplatform.member.startup;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.pentaho.di.core.plugins.DatabasePluginType;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;


/**
 * @Author: 黄子奇
 * @Date: 2019/10/8 11:10
 */
@Component
public class KettleDatabaseRunner implements ApplicationRunner {
    private final Log logger = LogFactory.getLog(KettleDatabaseRunner.class);

    @Override
    public void run(ApplicationArguments args) throws Exception {
        logger.info("开始对database type进行赋值");
        PluginRegistry.addPluginType(DatabasePluginType.getInstance());
        logger.info("开始执行kettle的db初始化");
        PluginRegistry.init();
    }
}
