package io.renren.config;


import io.renren.common.utils.ArgoUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Argo配置
 *
 * @author Zhang
 * @version 3.0.0
 * @since JDK1.8

 */
@Configuration
@Slf4j
public class ArgoConfig {
    @Value("${argo.basepath}")
    private String basePath;
    @Value("${argo.minioendpoint}")
    private String minioendpoint;
    @Value("${argo.minioAccess-key}")
    private String minioAccesskey;
    @Value("${argo.minioSecret-key}")
    private String minioSecretkey;

    @Value("${argo.sparkMasterRest}")
    private String sparkMasterRest;
    @Value("${argo.sparkMaster}")
    private String sparkMaster;
    @Value("${argo.sparkHdfsurl}")
    private String sparkHdfsurl;

    @Value("${argo.sparkYarnAddress}")
    private String sparkYarnAddress;
    @Value("${argo.sparkYarnJARS}")
    private String sparkYarnJARS;


    /**
     * 创建Argo apiclient
     * @return ArgoUtils
     */
    @Bean
    public ArgoUtils createArgoApiClient(){
        return new ArgoUtils(basePath,minioendpoint,minioAccesskey,minioSecretkey,sparkMasterRest,sparkMaster,sparkHdfsurl,sparkYarnAddress,sparkYarnJARS);
    }


}
