private void addTask(TaskProfile taskProfile) {
        if (taskMap.size() >= taskMaxLimit) {
            LOGGER.error("taskMap size {} over limit {}", taskMap.size(), taskMaxLimit);
            return;
        }
        if (!isProfileValid(taskProfile)) {
            LOGGER.error("task profile invalid {}", taskProfile.toJsonStr());
            return;
        }
        addToStore(taskProfile);
        TaskStateEnum state = TaskStateEnum.getTaskState(taskProfile.getInt(TASK_STATE));
        if (state == TaskStateEnum.RUNNING) {
            addToMemory(taskProfile);
        } else {
            LOGGER.info("taskId {} state {} no need to add to memory", taskProfile.getTaskId(),
                    taskProfile.getState());
        }
    }
add task profile to task store
if task state is RUNNING then add task to memory
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/task/TaskManager.java