package com.lanyuanxiaoyao.service.launcher.configuration;

import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Hudi 配置
 *
 * @author ZhangJiacheng
 * @date 2023-02-03
 */
@ConfigurationProperties("connector.hudi")
@Component
public class HudiConfiguration {
    private static final Logger logger = LoggerFactory.getLogger(HudiConfiguration.class);

    private String appHdfsPath;
    private String victoriaPushUrl;
    private String lokiPushUrl;

    @PostConstruct
    private void init() {
        logger.info("Configuration initial: {}", this);
    }

    public String getAppHdfsPath() {
        return appHdfsPath;
    }

    public void setAppHdfsPath(String appHdfsPath) {
        this.appHdfsPath = appHdfsPath;
    }

    public String getVictoriaPushUrl() {
        return victoriaPushUrl;
    }

    public void setVictoriaPushUrl(String victoriaPushUrl) {
        this.victoriaPushUrl = victoriaPushUrl;
    }

    public String getLokiPushUrl() {
        return lokiPushUrl;
    }

    public void setLokiPushUrl(String lokiPushUrl) {
        this.lokiPushUrl = lokiPushUrl;
    }

    @Override
    public String toString() {
        return "HudiConfiguration{" +
               "appHdfsPath='" + appHdfsPath + '\'' +
               ", victoriaPushUrl='" + victoriaPushUrl + '\'' +
               ", lokiPushUrl='" + lokiPushUrl + '\'' +
               '}';
    }
}
