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
1dcf47e2
Commit
1dcf47e2
authored
Dec 23, 2019
by
huangfusuper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【日志被重复添加】修改日志被重复添加的BUG
parent
fef7d1cd
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
76 additions
and
15 deletions
+76
-15
MythJobFlowCurrent.java
...core/src/main/java/com/byit/model/MythJobFlowCurrent.java
+3
-0
MythJobFlowDependent.java
...re/src/main/java/com/byit/model/MythJobFlowDependent.java
+4
-0
MythJobFlowNodeCurrent.java
.../src/main/java/com/byit/model/MythJobFlowNodeCurrent.java
+5
-1
MythJobFlowNodeVersion.java
.../src/main/java/com/byit/model/MythJobFlowNodeVersion.java
+5
-1
MythJobFlowRunRecording.java
...src/main/java/com/byit/model/MythJobFlowRunRecording.java
+4
-0
MythJobFlowVersion.java
...core/src/main/java/com/byit/model/MythJobFlowVersion.java
+4
-0
MythJobTask.java
...-admin-core/src/main/java/com/byit/model/MythJobTask.java
+4
-0
MythJobTaskRunLog.java
...-core/src/main/java/com/byit/model/MythJobTaskRunLog.java
+9
-3
MythJobTaskSchedule.java
...ore/src/main/java/com/byit/model/MythJobTaskSchedule.java
+5
-1
MythJobTaskRunLogService.java
.../main/java/com/byit/service/MythJobTaskRunLogService.java
+6
-0
MythJobTaskRunLogServiceImpl.java
...a/com/byit/service/impl/MythJobTaskRunLogServiceImpl.java
+6
-0
JobScheduleHelper.java
...core/src/main/java/com/byit/thread/JobScheduleHelper.java
+3
-1
SourceObj2TargetObjUtil.java
.../src/main/java/com/byit/util/SourceObj2TargetObjUtil.java
+2
-1
JobResultEnum.java
...ommon/src/main/java/com/byit/job/enums/JobResultEnum.java
+5
-3
RunJobServerHandler.java
...lugin/src/main/java/com/byit/rpc/RunJobServerHandler.java
+11
-4
No files found.
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowCurrent.java
View file @
1dcf47e2
...
@@ -2,6 +2,7 @@ package com.byit.model;
...
@@ -2,6 +2,7 @@ package com.byit.model;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -18,6 +19,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -18,6 +19,8 @@ import java.util.concurrent.TimeUnit;
@NoArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@DynamicInsert
@DynamicUpdate
@Entity
@Entity
@Table
(
name
=
"job_flow_current"
)
@Table
(
name
=
"job_flow_current"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_current"
,
comment
=
"任务流的当前版本的表,现实表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_current"
,
comment
=
"任务流的当前版本的表,现实表"
)
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowDependent.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
...
@@ -16,6 +18,8 @@ import java.io.Serializable;
...
@@ -16,6 +18,8 @@ import java.io.Serializable;
@NoArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@DynamicInsert
@DynamicUpdate
@Entity
@Entity
@Table
(
name
=
"job_flow_dependent"
)
@Table
(
name
=
"job_flow_dependent"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_dependent"
,
comment
=
"任务流的关联表,现实表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_dependent"
,
comment
=
"任务流的关联表,现实表"
)
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowNodeCurrent.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -17,6 +19,8 @@ import java.util.Date;
...
@@ -17,6 +19,8 @@ import java.util.Date;
@NoArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@DynamicInsert
@DynamicUpdate
@Entity
@Entity
@Table
(
name
=
"job_flow_node_current"
)
@Table
(
name
=
"job_flow_node_current"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_node_current"
,
comment
=
"这是任务流当前版本的节点表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_node_current"
,
comment
=
"这是任务流当前版本的节点表"
)
...
@@ -161,7 +165,7 @@ public class MythJobFlowNodeCurrent implements Serializable {
...
@@ -161,7 +165,7 @@ public class MythJobFlowNodeCurrent implements Serializable {
/**
/**
* 当前任务的类型 java python shell sql script
* 当前任务的类型 java python shell sql script
*/
*/
@Column
(
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
private
String
jobType
;
private
String
jobType
;
/**
/**
* 设置任务的优先级 1最低 2最高
* 设置任务的优先级 1最低 2最高
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowNodeVersion.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -18,6 +20,8 @@ import java.util.Date;
...
@@ -18,6 +20,8 @@ import java.util.Date;
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"job_flow_node_version"
)
@Table
(
name
=
"job_flow_node_version"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_node_version"
,
comment
=
"节点的版本表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_node_version"
,
comment
=
"节点的版本表"
)
public
class
MythJobFlowNodeVersion
implements
Serializable
{
public
class
MythJobFlowNodeVersion
implements
Serializable
{
...
@@ -171,7 +175,7 @@ public class MythJobFlowNodeVersion implements Serializable {
...
@@ -171,7 +175,7 @@ public class MythJobFlowNodeVersion implements Serializable {
/**
/**
* 当前任务的类型 java python shell sql script
* 当前任务的类型 java python shell sql script
*/
*/
@Column
(
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
private
String
jobType
;
private
String
jobType
;
/**
/**
* 设置任务的优先级 1最低 2最高
* 设置任务的优先级 1最低 2最高
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowRunRecording.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -17,6 +19,8 @@ import java.io.Serializable;
...
@@ -17,6 +19,8 @@ import java.io.Serializable;
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"job_flow_run_recording"
)
@Table
(
name
=
"job_flow_run_recording"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_run_recording"
,
comment
=
"任务流的执行记录表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_run_recording"
,
comment
=
"任务流的执行记录表"
)
public
class
MythJobFlowRunRecording
implements
Serializable
{
public
class
MythJobFlowRunRecording
implements
Serializable
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobFlowVersion.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -18,6 +20,8 @@ import java.util.Date;
...
@@ -18,6 +20,8 @@ import java.util.Date;
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"job_flow_version"
)
@Table
(
name
=
"job_flow_version"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_version"
,
comment
=
"这个实体是任务流的版本表"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_flow_version"
,
comment
=
"这个实体是任务流的版本表"
)
public
class
MythJobFlowVersion
implements
Serializable
{
public
class
MythJobFlowVersion
implements
Serializable
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobTask.java
View file @
1dcf47e2
...
@@ -2,6 +2,8 @@ package com.byit.model;
...
@@ -2,6 +2,8 @@ package com.byit.model;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -19,6 +21,8 @@ import java.util.Date;
...
@@ -19,6 +21,8 @@ import java.util.Date;
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"job_task"
)
@Table
(
name
=
"job_task"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task"
,
comment
=
"任务表,即将执行的任务全在这个表;工作任务"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task"
,
comment
=
"任务表,即将执行的任务全在这个表;工作任务"
)
public
class
MythJobTask
implements
Serializable
{
public
class
MythJobTask
implements
Serializable
{
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobTaskRunLog.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -19,6 +21,8 @@ import java.util.Date;
...
@@ -19,6 +21,8 @@ import java.util.Date;
@Builder
@Builder
@Entity
@Entity
@Table
(
name
=
"job_task_run_log"
)
@Table
(
name
=
"job_task_run_log"
)
@DynamicInsert
@DynamicUpdate
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task_run_log"
,
comment
=
"节点执行日志"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task_run_log"
,
comment
=
"节点执行日志"
)
public
class
MythJobTaskRunLog
implements
Serializable
{
public
class
MythJobTaskRunLog
implements
Serializable
{
/**
/**
...
@@ -81,7 +85,7 @@ public class MythJobTaskRunLog implements Serializable {
...
@@ -81,7 +85,7 @@ public class MythJobTaskRunLog implements Serializable {
/**
/**
* 调度结果 1成功 2失败
* 调度结果 1成功 2失败
*/
*/
@Column
(
columnDefinition
=
"
char(1
) COMMENT '调度结果 1成功 2失败'"
)
@Column
(
columnDefinition
=
"
varchar(13
) COMMENT '调度结果 1成功 2失败'"
)
private
String
triggerCode
;
private
String
triggerCode
;
/**
/**
* 调度信息
* 调度信息
...
@@ -94,9 +98,9 @@ public class MythJobTaskRunLog implements Serializable {
...
@@ -94,9 +98,9 @@ public class MythJobTaskRunLog implements Serializable {
@Column
(
columnDefinition
=
"DATE COMMENT '执行时间'"
)
@Column
(
columnDefinition
=
"DATE COMMENT '执行时间'"
)
private
Date
runTime
;
private
Date
runTime
;
/**
/**
* 运行结果 0未执行完成
1成功 2失败
* 运行结果 0未执行完成
*/
*/
@Column
(
columnDefinition
=
"
char(1
) COMMENT '运行结果'"
)
@Column
(
columnDefinition
=
"
varchar(13
) COMMENT '运行结果'"
)
private
String
runCode
;
private
String
runCode
;
/**
/**
* 运行结果信息
* 运行结果信息
...
@@ -124,5 +128,7 @@ public class MythJobTaskRunLog implements Serializable {
...
@@ -124,5 +128,7 @@ public class MythJobTaskRunLog implements Serializable {
*/
*/
@Column
(
columnDefinition
=
"char(1) COMMENT '告警结果,1-告警成功 2-告警失败'"
)
@Column
(
columnDefinition
=
"char(1) COMMENT '告警结果,1-告警成功 2-告警失败'"
)
private
String
alarmStatus
;
private
String
alarmStatus
;
@Column
(
nullable
=
false
,
columnDefinition
=
"varchar(13) COMMENT '任务类型 BEAN ACTUATOR'"
)
private
String
jobType
;
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/model/MythJobTaskSchedule.java
View file @
1dcf47e2
package
com
.
byit
.
model
;
package
com
.
byit
.
model
;
import
lombok.*
;
import
lombok.*
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -18,6 +20,8 @@ import java.util.Date;
...
@@ -18,6 +20,8 @@ import java.util.Date;
@EqualsAndHashCode
@EqualsAndHashCode
@Builder
@Builder
@Entity
@Entity
@DynamicInsert
@DynamicUpdate
@Table
(
name
=
"job_task_schedule"
)
@Table
(
name
=
"job_task_schedule"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task_schedule"
,
comment
=
"工作任务排期表,存储七秒内即将执行的任务节点,这个表也是对接工作流的"
)
@org
.
hibernate
.
annotations
.
Table
(
appliesTo
=
"job_task_schedule"
,
comment
=
"工作任务排期表,存储七秒内即将执行的任务节点,这个表也是对接工作流的"
)
public
class
MythJobTaskSchedule
implements
Serializable
{
public
class
MythJobTaskSchedule
implements
Serializable
{
...
@@ -171,7 +175,7 @@ public class MythJobTaskSchedule implements Serializable {
...
@@ -171,7 +175,7 @@ public class MythJobTaskSchedule implements Serializable {
/**
/**
* 当前任务的类型 java python shell sql script
* 当前任务的类型 java python shell sql script
*/
*/
@Column
(
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
@Column
(
nullable
=
false
,
columnDefinition
=
"varchar(36) COMMENT '当前任务的类型 java python shell sql script'"
)
private
String
jobType
;
private
String
jobType
;
/**
/**
* 设置任务的优先级 1最低 2最高
* 设置任务的优先级 1最低 2最高
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/MythJobTaskRunLogService.java
View file @
1dcf47e2
...
@@ -10,6 +10,12 @@ import com.byit.model.MythJobTaskRunLog;
...
@@ -10,6 +10,12 @@ import com.byit.model.MythJobTaskRunLog;
**/
**/
public
interface
MythJobTaskRunLogService
{
public
interface
MythJobTaskRunLogService
{
/**
/**
* 查询一条数据 根据ID
* @param id
* @return
*/
MythJobTaskRunLog
findMythJobTaskRunLogById
(
Integer
id
);
/**
* 既是保存接口又是修改接口
* 既是保存接口又是修改接口
* @return
* @return
*/
*/
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/service/impl/MythJobTaskRunLogServiceImpl.java
View file @
1dcf47e2
...
@@ -16,6 +16,12 @@ import org.springframework.stereotype.Service;
...
@@ -16,6 +16,12 @@ import org.springframework.stereotype.Service;
public
class
MythJobTaskRunLogServiceImpl
implements
MythJobTaskRunLogService
{
public
class
MythJobTaskRunLogServiceImpl
implements
MythJobTaskRunLogService
{
@Autowired
@Autowired
private
MythJobTaskRunLogRepository
mythJobTaskRunLogRepository
;
private
MythJobTaskRunLogRepository
mythJobTaskRunLogRepository
;
@Override
public
MythJobTaskRunLog
findMythJobTaskRunLogById
(
Integer
id
)
{
return
mythJobTaskRunLogRepository
.
findOne
(
id
);
}
@Override
@Override
public
MythJobTaskRunLog
save
(
MythJobTaskRunLog
mythJobTaskRunLog
)
{
public
MythJobTaskRunLog
save
(
MythJobTaskRunLog
mythJobTaskRunLog
)
{
return
mythJobTaskRunLogRepository
.
save
(
mythJobTaskRunLog
);
return
mythJobTaskRunLogRepository
.
save
(
mythJobTaskRunLog
);
...
...
byit-myth-core/myth-admin-core/src/main/java/com/byit/thread/JobScheduleHelper.java
View file @
1dcf47e2
...
@@ -242,9 +242,9 @@ public class JobScheduleHelper{
...
@@ -242,9 +242,9 @@ public class JobScheduleHelper{
if
(
CollectionUtil
.
isNotEmpty
(
mythJobTaskSchedules
)){
if
(
CollectionUtil
.
isNotEmpty
(
mythJobTaskSchedules
)){
//循环遍历添加任务
//循环遍历添加任务
mythJobTaskSchedules
.
forEach
(
mythJobTaskSchedule
->{
mythJobTaskSchedules
.
forEach
(
mythJobTaskSchedule
->{
if
(
"BEAN"
.
equals
(
mythJobTaskSchedule
.
getJobType
()))
{
Integer
logId
=
saveLog
(
mythJobTaskSchedule
);
Integer
logId
=
saveLog
(
mythJobTaskSchedule
);
mythJobTaskSchedule
.
setLogId
(
logId
);
mythJobTaskSchedule
.
setLogId
(
logId
);
if
(
"BEAN"
.
equals
(
mythJobTaskSchedule
.
getJobType
()))
{
JavaBeanJobTask
javaBeanJobTask
=
new
JavaBeanJobTask
(
mythJobTaskSchedule
);
JavaBeanJobTask
javaBeanJobTask
=
new
JavaBeanJobTask
(
mythJobTaskSchedule
);
mythJobTaskScheduleService
.
delete
(
mythJobTaskSchedule
.
getNodeId
());
mythJobTaskScheduleService
.
delete
(
mythJobTaskSchedule
.
getNodeId
());
WorkRoulette
.
addJob
(
javaBeanJobTask
,
mythJobTaskSchedule
.
getTriggerNextTime
());
WorkRoulette
.
addJob
(
javaBeanJobTask
,
mythJobTaskSchedule
.
getTriggerNextTime
());
...
@@ -336,8 +336,10 @@ public class JobScheduleHelper{
...
@@ -336,8 +336,10 @@ public class JobScheduleHelper{
mythJobTaskRunLog
.
setFailedRemainingCount
(
mythJobTaskSchedule
.
getFailedRetryCount
());
mythJobTaskRunLog
.
setFailedRemainingCount
(
mythJobTaskSchedule
.
getFailedRetryCount
());
mythJobTaskRunLog
.
setAlarmEmail
(
mythJobTaskSchedule
.
getAlarmEmail
());
mythJobTaskRunLog
.
setAlarmEmail
(
mythJobTaskSchedule
.
getAlarmEmail
());
mythJobTaskRunLog
.
setMailAction
(
mythJobTaskSchedule
.
getMailAction
());
mythJobTaskRunLog
.
setMailAction
(
mythJobTaskSchedule
.
getMailAction
());
mythJobTaskRunLog
.
setJobType
(
mythJobTaskSchedule
.
getJobType
());
MythJobTaskRunLogServiceImpl
mythJobTaskRunLogService
=
SpringUtil
.
getBean
(
MythJobTaskRunLogServiceImpl
.
class
);
MythJobTaskRunLogServiceImpl
mythJobTaskRunLogService
=
SpringUtil
.
getBean
(
MythJobTaskRunLogServiceImpl
.
class
);
MythJobTaskRunLog
mythJobTaskRunLogSave
=
mythJobTaskRunLogService
.
save
(
mythJobTaskRunLog
);
MythJobTaskRunLog
mythJobTaskRunLogSave
=
mythJobTaskRunLogService
.
save
(
mythJobTaskRunLog
);
return
mythJobTaskRunLogSave
.
getLogId
();
return
mythJobTaskRunLogSave
.
getLogId
();
}
}
}
}
byit-myth-core/myth-admin-core/src/main/java/com/byit/util/SourceObj2TargetObjUtil.java
View file @
1dcf47e2
...
@@ -33,7 +33,8 @@ public class SourceObj2TargetObjUtil {
...
@@ -33,7 +33,8 @@ public class SourceObj2TargetObjUtil {
mythJobTask
.
setSourcePrincipal
(
pluginBeanJobInfo
.
getAuthor
());
mythJobTask
.
setSourcePrincipal
(
pluginBeanJobInfo
.
getAuthor
());
mythJobTask
.
setNodeName
(
pluginBeanJobInfo
.
getJobHandelName
());
mythJobTask
.
setNodeName
(
pluginBeanJobInfo
.
getJobHandelName
());
mythJobTask
.
setTriggerNextTime
(
System
.
currentTimeMillis
()+
20000
);
mythJobTask
.
setTriggerNextTime
(
System
.
currentTimeMillis
()+
20000
);
mythJobTask
.
setDependencyNodes
(
"1"
);
mythJobTask
.
setDependencyNodes
(
"0"
);
mythJobTask
.
setJobType
(
"BEAN"
);
return
mythJobTask
;
return
mythJobTask
;
}
}
}
}
byit-myth-core/myth-core-common/src/main/java/com/byit/job/enums/JobResultEnum.java
View file @
1dcf47e2
...
@@ -5,9 +5,11 @@ package com.byit.job.enums;
...
@@ -5,9 +5,11 @@ package com.byit.job.enums;
* @author huangfu
* @author huangfu
*/
*/
public
enum
JobResultEnum
implements
IEnum
{
public
enum
JobResultEnum
implements
IEnum
{
SUCCESS
(
"200"
,
"任务执行成功"
),
SUCCESS
(
"100200"
,
"任务执行成功"
),
FAIL
(
"500"
,
"任务执行失败"
),
FAIL
(
"100500"
,
"任务执行失败"
),
FAIL_TIMEOUT
(
"502"
,
"超时错误"
);
FAIL_TIMEOUT
(
"100502"
,
"超时错误"
),
DISPATCH_SUCCESS
(
"200200"
,
"调度成功"
),
DISPATCH_FAIL
(
"200500"
,
"调度失败"
);
private
String
code
;
private
String
code
;
private
String
msg
;
private
String
msg
;
...
...
byit-myth-executor/myth-exector-plugin/src/main/java/com/byit/rpc/RunJobServerHandler.java
View file @
1dcf47e2
...
@@ -2,6 +2,8 @@ package com.byit.rpc;
...
@@ -2,6 +2,8 @@ package com.byit.rpc;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.byit.job.dto.AdminSenPluginDto
;
import
com.byit.job.dto.AdminSenPluginDto
;
import
com.byit.job.dto.DispatchResponseDto
;
import
com.byit.job.enums.JobResultEnum
;
import
io.netty.buffer.ByteBuf
;
import
io.netty.buffer.ByteBuf
;
import
io.netty.buffer.Unpooled
;
import
io.netty.buffer.Unpooled
;
import
io.netty.channel.ChannelHandlerContext
;
import
io.netty.channel.ChannelHandlerContext
;
...
@@ -38,7 +40,9 @@ public class RunJobServerHandler extends SimpleChannelInboundHandler<FullHttpReq
...
@@ -38,7 +40,9 @@ public class RunJobServerHandler extends SimpleChannelInboundHandler<FullHttpReq
@Override
@Override
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
FullHttpRequest
req
)
throws
Exception
{
protected
void
channelRead0
(
ChannelHandlerContext
ctx
,
FullHttpRequest
req
)
throws
Exception
{
log
.
debug
(
"----------------------有请求过来了------------------------"
);
log
.
debug
(
"----------------------有请求过来了------------------------"
);
String
heartbeatResponseBody
=
"FAILURE"
;
DispatchResponseDto
dispatchResponseDto
=
new
DispatchResponseDto
();
dispatchResponseDto
.
setCode
(
JobResultEnum
.
DISPATCH_FAIL
.
getCode
());
dispatchResponseDto
.
setMsg
(
JobResultEnum
.
DISPATCH_FAIL
.
getMsg
());
if
(
req
!=
null
){
if
(
req
!=
null
){
//解析 调度中心 的数据对象
//解析 调度中心 的数据对象
AdminSenPluginDto
adminSenPluginDto
=
analysisParam
(
req
.
content
(
));
AdminSenPluginDto
adminSenPluginDto
=
analysisParam
(
req
.
content
(
));
...
@@ -49,13 +53,16 @@ public class RunJobServerHandler extends SimpleChannelInboundHandler<FullHttpReq
...
@@ -49,13 +53,16 @@ public class RunJobServerHandler extends SimpleChannelInboundHandler<FullHttpReq
String
heartbeat
=
adminSenPluginDto
.
getHeartbeat
();
String
heartbeat
=
adminSenPluginDto
.
getHeartbeat
();
if
(
null
==
heartbeat
){
if
(
null
==
heartbeat
){
JOB_TRIGGER_POOL
.
execute
(
new
RunJobThread
(
adminSenPluginDto
));
JOB_TRIGGER_POOL
.
execute
(
new
RunJobThread
(
adminSenPluginDto
));
heartbeatResponseBody
=
"SUCCESS"
;
dispatchResponseDto
.
setCode
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getCode
());
dispatchResponseDto
.
setMsg
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getMsg
());
}
else
if
(
PENG
.
equals
(
heartbeat
)){
}
else
if
(
PENG
.
equals
(
heartbeat
)){
log
.
debug
(
"----------调度平台心跳检测-------------"
);
log
.
debug
(
"----------调度平台心跳检测-------------"
);
heartbeatResponseBody
=
PONG
;
dispatchResponseDto
.
setCode
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getCode
());
dispatchResponseDto
.
setMsg
(
JobResultEnum
.
DISPATCH_SUCCESS
.
getMsg
());
dispatchResponseDto
.
setContent
(
PONG
);
}
}
//----------------------------------消息发送-----------------------------------
//----------------------------------消息发送-----------------------------------
ByteBuf
byteBuf
=
Unpooled
.
copiedBuffer
(
heartbeatResponseBody
,
CharsetUtil
.
UTF_8
);
ByteBuf
byteBuf
=
Unpooled
.
copiedBuffer
(
JSON
.
toJSONString
(
dispatchResponseDto
)
,
CharsetUtil
.
UTF_8
);
//HTTP响应
//HTTP响应
FullHttpResponse
response
=
new
DefaultFullHttpResponse
(
HttpVersion
.
HTTP_1_1
,
HttpResponseStatus
.
OK
,
byteBuf
);
FullHttpResponse
response
=
new
DefaultFullHttpResponse
(
HttpVersion
.
HTTP_1_1
,
HttpResponseStatus
.
OK
,
byteBuf
);
//设置头信息
//设置头信息
...
...
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