package com.lanyuanxiaoyao.service.configuration.entity.flink;

import com.fasterxml.jackson.annotation.JsonAlias;

/**
 * Checkpoint config
 *
 * @author lanyuanxiaoyao
 * @date 2023-05-04
 */
public class FlinkCheckpointConfig {
    private String mode;
    private Long interval;
    private Long timeout;
    @JsonAlias("min_pause")
    private Long minPause;
    @JsonAlias("max_concurrent")
    private Long maxConcurrent;
    @JsonAlias("state_backend")
    private String stateBackend;
    @JsonAlias("checkpoint_storage")
    private String checkpointStorage;
    @JsonAlias("unaligned_checkpoints")
    private Boolean unalignedCheckpoints;
    @JsonAlias("tolerable_failed_checkpoints")
    private Integer tolerableFailedCheckpoints;

    public String getMode() {
        return mode;
    }

    public Long getInterval() {
        return interval;
    }

    public Long getTimeout() {
        return timeout;
    }

    public Long getMinPause() {
        return minPause;
    }

    public Long getMaxConcurrent() {
        return maxConcurrent;
    }

    public String getStateBackend() {
        return stateBackend;
    }

    public String getCheckpointStorage() {
        return checkpointStorage;
    }

    public Boolean isUnalignedCheckpoints() {
        return unalignedCheckpoints;
    }

    public Integer getTolerableFailedCheckpoints() {
        return tolerableFailedCheckpoints;
    }

    @Override
    public String toString() {
        return "FlinkCheckpointConfig{" +
                "mode='" + mode + '\'' +
                ", interval=" + interval +
                ", timeout=" + timeout +
                ", minPause=" + minPause +
                ", maxConcurrent=" + maxConcurrent +
                ", stateBackend='" + stateBackend + '\'' +
                ", checkpointStorage='" + checkpointStorage + '\'' +
                ", unalignedCheckpoints=" + unalignedCheckpoints +
                ", tolerableFailedCheckpoints=" + tolerableFailedCheckpoints +
                '}';
    }
}
