package com.lanyuanxiaoyao.service.command.commands.jobs;

import org.eclipse.collections.api.list.ImmutableList;

/**
 * @date 2022-06-29
 */
public interface Adder {
    void execute();

    class Job implements Cloneable {
        public Long id;
        public String name;
        public String runMode;
        public ImmutableList<Table> tables;
        public Boolean isAppended;

        public Job(Long id, String name, String runMode, ImmutableList<Table> tables, Boolean isAppended) {
            this.id = id;
            this.name = name;
            this.runMode = runMode;
            this.tables = tables;
            this.isAppended = isAppended;
        }
    }

    class Table {
        public Long id;
        public String alias;
        public Long hudiJobId;
        public Long syncYarnJobId;
        public Long compactionYarnJobId;
        public String srcDb;
        public String srcType;
        public String srcSchema;
        public String srcTable;
        public String srcPulsarAddr;
        public String srcTopic;
        public String tgtDb;
        public String tgtTable;
        public String tgtHdfsPath;
        public String filterField;
        public String filterValues;
        public String filterType;
        public Long bucketNumber;

        public Table(Long id, String alias, Long hudiJobId, Long syncYarnJobId, Long compactionYarnJobId, String srcDb, String srcType, String srcSchema, String srcTable, String srcPulsarAddr, String srcTopic, String tgtDb, String tgtTable, String tgtHdfsPath, String filterField, String filterValues, String filterType, Long bucketNumber) {
            this.id = id;
            this.alias = alias;
            this.hudiJobId = hudiJobId;
            this.syncYarnJobId = syncYarnJobId;
            this.compactionYarnJobId = compactionYarnJobId;
            this.srcDb = srcDb;
            this.srcType = srcType;
            this.srcSchema = srcSchema;
            this.srcTable = srcTable;
            this.srcPulsarAddr = srcPulsarAddr;
            this.srcTopic = srcTopic;
            this.tgtDb = tgtDb;
            this.tgtTable = tgtTable;
            this.tgtHdfsPath = tgtHdfsPath;
            this.filterField = filterField;
            this.filterValues = filterValues;
            this.filterType = filterType;
            this.bucketNumber = bucketNumber;
        }
    }
}
