/**
 * 
 */
package org.springblade.etl.engine.seatunnel;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author wookvn
 * {@link org.apache.seatunnel.core.starter.flink.utils.ConfigKeyName}
 * {@link org.apache.seatunnel.api.env.EnvCommonOptions}
 *
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class SeatunnelJobEnv implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@JsonProperty("job.name")
	private String jobName;
	/**
	 * BATCH, STREAMING
	 */
	@JsonProperty("job.mode")
	private String jobMode;
	
	@JsonProperty("execution.parallelism")
	private Integer parallelism = 1;
	
	/**
	 * execution.checkpoint.interval
	 * 当interval>0，开启checkpoint功能
	 */
	@JsonProperty("checkpoint.interval")
	private Long checkpointInterval;
	
	@JsonProperty("execution.checkpoint.data-uri")
	private String checkpointDataUri;
	
	/**
	 * no
	 * fixed-delay
	 * failure-rate
	 */
	@JsonProperty("execution.restart.strategy")
	private String restartStrategy = "no";

	@JsonProperty("execution.checkpoint.cleanup-mode")
	private String checkpointCleanupMode;
	
	@JsonProperty("execution.checkpoint.unaligned")
	private String checkpointForceUnaligned = "true";

	/**
	 * @param jobName
	 * @param jobMode
	 */
	public SeatunnelJobEnv(String jobName, String jobMode) {
		super();
		this.jobName = jobName;
		this.jobMode = jobMode;
	}
}
