Commit a9b6a88a by guominglei

插件端重跑节点

parent 8fefb13e
...@@ -420,6 +420,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -420,6 +420,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
String runState = jsonObject.getString("runState"); String runState = jsonObject.getString("runState");
ValidationUtil.dataNotBank(runState, "重跑机制不允许为空!"); ValidationUtil.dataNotBank(runState, "重跑机制不允许为空!");
//获取要重跑的运行记录id //获取要重跑的运行记录id
String runId = jsonObject.getString("runId"); String runId = jsonObject.getString("runId");
ValidationUtil.dataNotBank(runId, "运行实例id不允许为空!"); ValidationUtil.dataNotBank(runId, "运行实例id不允许为空!");
...@@ -434,10 +435,22 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -434,10 +435,22 @@ public class ApiFlowServiceImpl implements ApiFlowService {
JobTaskRunLog jobTaskRunLog = jobTaskRunLogMapper.findByRunIdAndNodeId(runId, node.getNodeId()); JobTaskRunLog jobTaskRunLog = jobTaskRunLogMapper.findByRunIdAndNodeId(runId, node.getNodeId());
ValidationUtil.dataNotNull(jobTaskRunLog, "查无此运行记录"); ValidationUtil.dataNotNull(jobTaskRunLog, "查无此运行记录");
//校验通过,开始设置重跑 //获取当前时间
//判断重跑机制(单节点重跑,节点及下游重跑) String reRunId = UUID.randomUUID().toString().replace("-","");
Long triggerTime = System.currentTimeMillis();
List<JobTask> jobTaskList = new ArrayList<>();
JobTask jobTask = new JobTask();
BeanUtils.copyProperties(node, jobTask);
jobTask.setTriggerTime(triggerTime);
jobTask.setTriggerStatus("1");
//校验通过,开始设置重跑
//判断重跑机制(单节点重跑,节点及下游重跑
if ("1".equals(runState)) {//如果是只重跑当前节点
jobTaskList.add(jobTask);
}
jobTaskMapper.saveJobTasks(jobTaskList);
} }
......
...@@ -195,6 +195,12 @@ public class JobTask implements Serializable { ...@@ -195,6 +195,12 @@ public class JobTask implements Serializable {
private String superSuccessRun; private String superSuccessRun;
/** /**
* 重跑的运行标识
*/
@ApiModelProperty("重跑的运行标识")
private String reRunId;
/**
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -195,6 +195,12 @@ public class JobTaskSchedule implements Serializable { ...@@ -195,6 +195,12 @@ public class JobTaskSchedule implements Serializable {
private String superSuccessRun; private String superSuccessRun;
/** /**
* 重跑的运行标识
*/
@ApiModelProperty("重跑的运行标识")
private String reRunId;
/**
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<result column="run_command" jdbcType="VARCHAR" property="runCommand" /> <result column="run_command" jdbcType="VARCHAR" property="runCommand" />
<result column="flow_name" jdbcType="VARCHAR" property="flowName" /> <result column="flow_name" jdbcType="VARCHAR" property="flowName" />
<result column="super_success_run" jdbcType="CHAR" property="superSuccessRun"/> <result column="super_success_run" jdbcType="CHAR" property="superSuccessRun"/>
<result column="re_run_id" jdbcType="VARCHAR" property="reRunId"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTask"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTask">
<!-- generated @mbg.generated date: 2019-12-25 --> <!-- generated @mbg.generated date: 2019-12-25 -->
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
run_command,flow_name, super_success_run run_command,flow_name, super_success_run, re_run_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
run_source run_source
...@@ -162,6 +163,9 @@ ...@@ -162,6 +163,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
super_success_run, super_success_run,
</if> </if>
<if test="reRunId != null">
re_run_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -254,6 +258,9 @@ ...@@ -254,6 +258,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
#{superSuccessRun,jdbcType=CHAR}, #{superSuccessRun,jdbcType=CHAR},
</if> </if>
<if test="reRunId != null">
#{reRunId,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
...@@ -263,7 +270,7 @@ ...@@ -263,7 +270,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
run_command,run_source,flow_name,super_success_run run_command,run_source,flow_name,super_success_run, re_run_id
) values ) values
<foreach collection="jobTasks" item="jobTask" separator =","> <foreach collection="jobTasks" item="jobTask" separator =",">
( (
...@@ -275,7 +282,7 @@ ...@@ -275,7 +282,7 @@
#{jobTask.runParam,jdbcType=VARCHAR},#{jobTask.runSourceDesc,jdbcType=VARCHAR},#{jobTask.scriptUrls,jdbcType=VARCHAR}, #{jobTask.runParam,jdbcType=VARCHAR},#{jobTask.runSourceDesc,jdbcType=VARCHAR},#{jobTask.scriptUrls,jdbcType=VARCHAR},
#{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR}, #{jobTask.sourcePrincipal,jdbcType=VARCHAR},#{jobTask.triggerTime,jdbcType=BIGINT},#{jobTask.triggerStatus,jdbcType=CHAR},
#{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR}, #{jobTask.versionName,jdbcType=VARCHAR},#{jobTask.runCommand,jdbcType=VARCHAR},#{jobTask.runSource,jdbcType=LONGVARCHAR},
#{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR} #{jobTask.flowName,jdbcType=VARCHAR},#{jobTask.superSuccessRun,jdbcType=CHAR}, ,#{jobTask.reRunId,jdbcType=VARCHAR}
) )
</foreach> </foreach>
...@@ -372,6 +379,9 @@ ...@@ -372,6 +379,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
super_success_run = #{superSuccessRun,jdbcType=CHAR}, super_success_run = #{superSuccessRun,jdbcType=CHAR},
</if> </if>
<if test="reRunId != null">
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
<result column="run_command" jdbcType="VARCHAR" property="runCommand"/> <result column="run_command" jdbcType="VARCHAR" property="runCommand"/>
<result column="flow_name" jdbcType="VARCHAR" property="flowName"/> <result column="flow_name" jdbcType="VARCHAR" property="flowName"/>
<result column="super_success_run" jdbcType="CHAR" property="superSuccessRun"/> <result column="super_success_run" jdbcType="CHAR" property="superSuccessRun"/>
<result column="re_run_id" jdbcType="VARCHAR" property="reRunId"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.byit.model.JobTaskSchedule">
...@@ -44,7 +45,7 @@ ...@@ -44,7 +45,7 @@
job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual, job_type, handler_name, node_desc, node_name, map_flow_id, node_timeout, is_virtual,
plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param, plugin_urls, priority, failed_retry_interval, routing_strategy, run_id, run_param,
run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name, run_source_desc, script_urls, source_principal, trigger_time, trigger_status, version_name,
log_id, run_command,flow_name, super_success_run log_id, run_command,flow_name, super_success_run, re_run_id
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
run_source run_source
...@@ -170,6 +171,9 @@ ...@@ -170,6 +171,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
super_success_run, super_success_run,
</if> </if>
<if test="reRunId != null">
re_run_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -265,6 +269,9 @@ ...@@ -265,6 +269,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
#{superSuccessRun,jdbcType=CHAR}, #{superSuccessRun,jdbcType=CHAR},
</if> </if>
<if test="reRunId != null">
#{reRunId,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
...@@ -278,7 +285,7 @@ ...@@ -278,7 +285,7 @@
run_id, run_param, run_source_desc, run_id, run_param, run_source_desc,
script_urls, source_principal, trigger_time, script_urls, source_principal, trigger_time,
trigger_status, version_name, log_id, trigger_status, version_name, log_id,
run_command, run_source,flow_name, super_success_run run_command, run_source,flow_name, super_success_run, re_run_id
) )
values values
<foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator=","> <foreach collection="jobTaskSchedules" item="jobTaskSchedule" separator=",">
...@@ -302,7 +309,8 @@ ...@@ -302,7 +309,8 @@
#{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.versionName,jdbcType=VARCHAR}, #{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.versionName,jdbcType=VARCHAR},
#{jobTaskSchedule.logId,jdbcType=INTEGER}, #{jobTaskSchedule.logId,jdbcType=INTEGER},
#{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR}, #{jobTaskSchedule.runCommand,jdbcType=VARCHAR}, #{jobTaskSchedule.runSource,jdbcType=LONGVARCHAR},
#{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR} #{jobTaskSchedule.flowName,jdbcType=VARCHAR}, #{jobTaskSchedule.superSuccessRun,jdbcType=CHAR},
#{jobTaskSchedule.reRunId,jdbcType=VARCHAR},
) )
</foreach> </foreach>
</insert> </insert>
...@@ -401,6 +409,9 @@ ...@@ -401,6 +409,9 @@
<if test="superSuccessRun != null"> <if test="superSuccessRun != null">
super_success_run = #{superSuccessRun,jdbcType=CHAR}, super_success_run = #{superSuccessRun,jdbcType=CHAR},
</if> </if>
<if test="reRunId != null">
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment