package com.lanyuanxiaoyao.service.executor.core;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * flink 任务信息上下文
 *
 * @author lanyuanxiaoyao
 * @date 2023-12-04
 */
public class TaskContext implements Serializable {
    private String taskId;
    private String resultPath;
    private Map<String, Object> metadata;

    public TaskContext() {
    }

    public TaskContext(String taskId, String resultPath) {
        this(taskId, resultPath, new HashMap<>());
    }

    public TaskContext(String taskId, String resultPath, Map<String, Object> metadata) {
        this.taskId = taskId;
        this.resultPath = resultPath;
        this.metadata = metadata;
    }

    public String getTaskId() {
        return taskId;
    }

    public String getResultPath() {
        return resultPath;
    }

    public Map<String, Object> getMetadata() {
        return metadata;
    }

    @Override
    public String toString() {
        return "TaskContext{" +
               "taskId='" + taskId + '\'' +
               ", resultPath='" + resultPath + '\'' +
               ", metadata=" + metadata +
               '}';
    }
}
