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

/**
 * @author lanyuanxiaoyao
 * @date 2023-06-14
 */
public class CompactionMetrics {
    private Long flinkJobId;
    private String alias;
    private String applicationId;
    private String cluster;
    private String compactionPlanInstant;
    private Boolean complete;
    private Long startedTime;
    private Long finishedTime;
    private Statistics before;
    private Statistics after;

    public CompactionMetrics() {
    }

    public CompactionMetrics(Long flinkJobId, String alias, String applicationId, String cluster, String compactionPlanInstant, Boolean complete, Long startedTime, Long finishedTime, Statistics before, Statistics after) {
        this.flinkJobId = flinkJobId;
        this.alias = alias;
        this.applicationId = applicationId;
        this.cluster = cluster;
        this.compactionPlanInstant = compactionPlanInstant;
        this.complete = complete;
        this.startedTime = startedTime;
        this.finishedTime = finishedTime;
        this.before = before;
        this.after = after;
    }

    public Long getFlinkJobId() {
        return flinkJobId;
    }

    public String getAlias() {
        return alias;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public String getCluster() {
        return cluster;
    }

    public String getCompactionPlanInstant() {
        return compactionPlanInstant;
    }

    public Boolean getComplete() {
        return complete;
    }

    public Long getStartedTime() {
        return startedTime;
    }

    public Long getFinishedTime() {
        return finishedTime;
    }

    public Statistics getBefore() {
        return before;
    }

    public Statistics getAfter() {
        return after;
    }

    @Override
    public String toString() {
        return "CompactionMetrics{" +
                "flinkJobId=" + flinkJobId +
                ", alias='" + alias + '\'' +
                ", applicationId='" + applicationId + '\'' +
                ", cluster='" + cluster + '\'' +
                ", compactionPlanInstant='" + compactionPlanInstant + '\'' +
                ", complete=" + complete +
                ", startedTime=" + startedTime +
                ", finishedTime=" + finishedTime +
                ", before=" + before +
                ", after=" + after +
                '}';
    }

    public static class Statistics {
        private Long totalScanTime;
        private Long totalLogFilesCompacted;
        private Long totalLogFilesSize;
        private Long totalRecordsDeleted;
        private Long totalRecordsUpdated;
        private Long totalRecordsCompacted;

        public Statistics() {
        }

        public Statistics(Long totalScanTime, Long totalLogFilesCompacted, Long totalLogFilesSize, Long totalRecordsDeleted, Long totalRecordsUpdated, Long totalRecordsCompacted) {
            this.totalScanTime = totalScanTime;
            this.totalLogFilesCompacted = totalLogFilesCompacted;
            this.totalLogFilesSize = totalLogFilesSize;
            this.totalRecordsDeleted = totalRecordsDeleted;
            this.totalRecordsUpdated = totalRecordsUpdated;
            this.totalRecordsCompacted = totalRecordsCompacted;
        }

        public Long getTotalScanTime() {
            return totalScanTime;
        }

        public Long getTotalLogFilesCompacted() {
            return totalLogFilesCompacted;
        }

        public Long getTotalLogFilesSize() {
            return totalLogFilesSize;
        }

        public Long getTotalRecordsDeleted() {
            return totalRecordsDeleted;
        }

        public Long getTotalRecordsUpdated() {
            return totalRecordsUpdated;
        }

        public Long getTotalRecordsCompacted() {
            return totalRecordsCompacted;
        }
    }
}
