Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
byit-myth-job
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyuan
byit-myth-job
Commits
a9b6a88a
Commit
a9b6a88a
authored
Feb 08, 2020
by
guominglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
插件端重跑节点
parent
8fefb13e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
8 deletions
+56
-8
ApiFlowServiceImpl.java
...c/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
+15
-2
JobTask.java
...myth-admin-core/src/main/java/com/byit/model/JobTask.java
+7
-0
JobTaskSchedule.java
...in-core/src/main/java/com/byit/model/JobTaskSchedule.java
+7
-0
JobTaskMapper.xml
...th-admin-core/src/main/resources/mapper/JobTaskMapper.xml
+13
-3
JobTaskScheduleMapper.xml
...-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
+14
-3
No files found.
byit-myth-admin/src/main/java/com/byit/service/impl/ApiFlowServiceImpl.java
View file @
a9b6a88a
...
...
@@ -420,6 +420,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
String
runState
=
jsonObject
.
getString
(
"runState"
);
ValidationUtil
.
dataNotBank
(
runState
,
"重跑机制不允许为空!"
);
//获取要重跑的运行记录id
String
runId
=
jsonObject
.
getString
(
"runId"
);
ValidationUtil
.
dataNotBank
(
runId
,
"运行实例id不允许为空!"
);
...
...
@@ -434,10 +435,22 @@ public class ApiFlowServiceImpl implements ApiFlowService {
JobTaskRunLog
jobTaskRunLog
=
jobTaskRunLogMapper
.
findByRunIdAndNodeId
(
runId
,
node
.
getNodeId
());
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
);
}
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/JobTask.java
View file @
a9b6a88a
...
...
@@ -195,6 +195,12 @@ public class JobTask implements Serializable {
private
String
superSuccessRun
;
/**
* 重跑的运行标识
*/
@ApiModelProperty
(
"重跑的运行标识"
)
private
String
reRunId
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/JobTaskSchedule.java
View file @
a9b6a88a
...
...
@@ -195,6 +195,12 @@ public class JobTaskSchedule implements Serializable {
private
String
superSuccessRun
;
/**
* 重跑的运行标识
*/
@ApiModelProperty
(
"重跑的运行标识"
)
private
String
reRunId
;
/**
*/
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskMapper.xml
View file @
a9b6a88a
...
...
@@ -32,6 +32,7 @@
<result
column=
"run_command"
jdbcType=
"VARCHAR"
property=
"runCommand"
/>
<result
column=
"flow_name"
jdbcType=
"VARCHAR"
property=
"flowName"
/>
<result
column=
"super_success_run"
jdbcType=
"CHAR"
property=
"superSuccessRun"
/>
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.byit.model.JobTask"
>
<!-- generated @mbg.generated date: 2019-12-25 -->
...
...
@@ -43,7 +44,7 @@
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,
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
id=
"Blob_Column_List"
>
run_source
...
...
@@ -162,6 +163,9 @@
<if
test=
"superSuccessRun != null"
>
super_success_run,
</if>
<if
test=
"reRunId != null"
>
re_run_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -254,6 +258,9 @@
<if
test=
"superSuccessRun != null"
>
#{superSuccessRun,jdbcType=CHAR},
</if>
<if
test=
"reRunId != null"
>
#{reRunId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
...
...
@@ -263,7 +270,7 @@
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,
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
<foreach
collection=
"jobTasks"
item=
"jobTask"
separator =
","
>
(
...
...
@@ -275,7 +282,7 @@
#{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.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>
...
...
@@ -372,6 +379,9 @@
<if
test=
"superSuccessRun != null"
>
super_success_run = #{superSuccessRun,jdbcType=CHAR},
</if>
<if
test=
"reRunId != null"
>
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
byit-myth-core/myth-admin-core/src/main/resources/mapper/JobTaskScheduleMapper.xml
View file @
a9b6a88a
...
...
@@ -33,6 +33,7 @@
<result
column=
"run_command"
jdbcType=
"VARCHAR"
property=
"runCommand"
/>
<result
column=
"flow_name"
jdbcType=
"VARCHAR"
property=
"flowName"
/>
<result
column=
"super_success_run"
jdbcType=
"CHAR"
property=
"superSuccessRun"
/>
<result
column=
"re_run_id"
jdbcType=
"VARCHAR"
property=
"reRunId"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.byit.model.JobTaskSchedule"
>
...
...
@@ -44,7 +45,7 @@
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,
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
id=
"Blob_Column_List"
>
run_source
...
...
@@ -170,6 +171,9 @@
<if
test=
"superSuccessRun != null"
>
super_success_run,
</if>
<if
test=
"reRunId != null"
>
re_run_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -265,6 +269,9 @@
<if
test=
"superSuccessRun != null"
>
#{superSuccessRun,jdbcType=CHAR},
</if>
<if
test=
"reRunId != null"
>
#{reRunId,jdbcType=VARCHAR},
</if>
</trim>
</insert>
...
...
@@ -278,7 +285,7 @@
run_id, run_param, run_source_desc,
script_urls, source_principal, trigger_time,
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
<foreach
collection=
"jobTaskSchedules"
item=
"jobTaskSchedule"
separator=
","
>
...
...
@@ -302,7 +309,8 @@
#{jobTaskSchedule.triggerStatus,jdbcType=CHAR}, #{jobTaskSchedule.versionName,jdbcType=VARCHAR},
#{jobTaskSchedule.logId,jdbcType=INTEGER},
#{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>
</insert>
...
...
@@ -401,6 +409,9 @@
<if
test=
"superSuccessRun != null"
>
super_success_run = #{superSuccessRun,jdbcType=CHAR},
</if>
<if
test=
"reRunId != null"
>
re_run_id = #{reRunId,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment