Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
23490980
提交
23490980
authored
4月 09, 2020
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
任务手动执行一次的时候,支持指定本次执行的机器地址,为空则从执行器获取
上级
1199cec9
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
44 行增加
和
13 行删除
+44
-13
XXL-JOB官方文档.md
doc/XXL-JOB官方文档.md
+2
-1
JobInfoController.java
.../java/com/xxl/job/admin/controller/JobInfoController.java
+2
-2
JobFailMonitorHelper.java
...a/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
+1
-1
JobScheduleHelper.java
...java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
+2
-2
JobTriggerPoolHelper.java
...a/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java
+9
-4
XxlJobTrigger.java
...in/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
+16
-1
AdminBizImpl.java
...ain/java/com/xxl/job/admin/service/impl/AdminBizImpl.java
+1
-1
message_en.properties
xxl-job-admin/src/main/resources/i18n/message_en.properties
+1
-0
message_zh_CN.properties
...ob-admin/src/main/resources/i18n/message_zh_CN.properties
+1
-0
message_zh_TC.properties
...ob-admin/src/main/resources/i18n/message_zh_TC.properties
+1
-0
jobinfo.index.1.js
...job-admin/src/main/resources/static/js/jobinfo.index.1.js
+2
-1
jobinfo.index.ftl
...in/src/main/resources/templates/jobinfo/jobinfo.index.ftl
+6
-0
没有找到文件。
doc/XXL-JOB官方文档.md
浏览文件 @
23490980
...
@@ -1731,8 +1731,9 @@ data: post-data
...
@@ -1731,8 +1731,9 @@ data: post-data
-
16、执行器初始化逻辑优化:修复懒加载的Bean被提前初始化问题;
-
16、执行器初始化逻辑优化:修复懒加载的Bean被提前初始化问题;
-
17、任务复制功能:点击复制是弹出新建任务弹框,并初始化被复制任务信息;
-
17、任务复制功能:点击复制是弹出新建任务弹框,并初始化被复制任务信息;
-
18、执行器UI交互优化,移除冗余order属性;
-
18、执行器UI交互优化,移除冗余order属性;
-
19、
[
迭代中
]
任务执行一次的时候指定IP;
-
19、
任务手动执行一次的时候,支持指定本次执行的机器地址,为空则从执行器获取
-
20、
[
迭代中
]
任务结果丢失处理:针对长期处于运行中的任务(设置过期时间时,运行超过"过期时间+1min";未设置超时时间时,运行超过"30min"),主动检测该执行器是否在线,如果不在线主动标记失败;
-
20、
[
迭代中
]
任务结果丢失处理:针对长期处于运行中的任务(设置过期时间时,运行超过"过期时间+1min";未设置超时时间时,运行超过"30min"),主动检测该执行器是否在线,如果不在线主动标记失败;
-
21、
[
迭代中
]
调度中心与执行器通讯规范为双向restful,方便跨语言,以及第三方执行器实现;通讯组件xxl-rpc方案调整为Jetty+Gson方案;
### TODO LIST
### TODO LIST
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
浏览文件 @
23490980
...
@@ -132,13 +132,13 @@ public class JobInfoController {
...
@@ -132,13 +132,13 @@ public class JobInfoController {
@RequestMapping
(
"/trigger"
)
@RequestMapping
(
"/trigger"
)
@ResponseBody
@ResponseBody
//@PermissionLimit(limit = false)
//@PermissionLimit(limit = false)
public
ReturnT
<
String
>
triggerJob
(
int
id
,
String
executorParam
)
{
public
ReturnT
<
String
>
triggerJob
(
int
id
,
String
executorParam
,
String
addressList
)
{
// force cover job param
// force cover job param
if
(
executorParam
==
null
)
{
if
(
executorParam
==
null
)
{
executorParam
=
""
;
executorParam
=
""
;
}
}
JobTriggerPoolHelper
.
trigger
(
id
,
TriggerTypeEnum
.
MANUAL
,
-
1
,
null
,
executorParam
);
JobTriggerPoolHelper
.
trigger
(
id
,
TriggerTypeEnum
.
MANUAL
,
-
1
,
null
,
executorParam
,
addressList
);
return
ReturnT
.
SUCCESS
;
return
ReturnT
.
SUCCESS
;
}
}
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
浏览文件 @
23490980
...
@@ -52,7 +52,7 @@ public class JobFailMonitorHelper {
...
@@ -52,7 +52,7 @@ public class JobFailMonitorHelper {
// 1、fail retry monitor
// 1、fail retry monitor
if
(
log
.
getExecutorFailRetryCount
()
>
0
)
{
if
(
log
.
getExecutorFailRetryCount
()
>
0
)
{
JobTriggerPoolHelper
.
trigger
(
log
.
getJobId
(),
TriggerTypeEnum
.
RETRY
,
(
log
.
getExecutorFailRetryCount
()-
1
),
log
.
getExecutorShardingParam
(),
log
.
getExecutorParam
());
JobTriggerPoolHelper
.
trigger
(
log
.
getJobId
(),
TriggerTypeEnum
.
RETRY
,
(
log
.
getExecutorFailRetryCount
()-
1
),
log
.
getExecutorShardingParam
(),
log
.
getExecutorParam
()
,
null
);
String
retryMsg
=
"<br><br><span style=\"color:#F39C12;\" > >>>>>>>>>>>"
+
I18nUtil
.
getString
(
"jobconf_trigger_type_retry"
)
+
"<<<<<<<<<<< </span><br>"
;
String
retryMsg
=
"<br><br><span style=\"color:#F39C12;\" > >>>>>>>>>>>"
+
I18nUtil
.
getString
(
"jobconf_trigger_type_retry"
)
+
"<<<<<<<<<<< </span><br>"
;
log
.
setTriggerMsg
(
log
.
getTriggerMsg
()
+
retryMsg
);
log
.
setTriggerMsg
(
log
.
getTriggerMsg
()
+
retryMsg
);
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobLogDao
().
updateTriggerInfo
(
log
);
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobLogDao
().
updateTriggerInfo
(
log
);
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobScheduleHelper.java
浏览文件 @
23490980
...
@@ -93,7 +93,7 @@ public class JobScheduleHelper {
...
@@ -93,7 +93,7 @@ public class JobScheduleHelper {
// 2.2、trigger-expire < 5s:direct-trigger && make next-trigger-time
// 2.2、trigger-expire < 5s:direct-trigger && make next-trigger-time
// 1、trigger
// 1、trigger
JobTriggerPoolHelper
.
trigger
(
jobInfo
.
getId
(),
TriggerTypeEnum
.
CRON
,
-
1
,
null
,
null
);
JobTriggerPoolHelper
.
trigger
(
jobInfo
.
getId
(),
TriggerTypeEnum
.
CRON
,
-
1
,
null
,
null
,
null
);
logger
.
debug
(
">>>>>>>>>>> xxl-job, schedule push trigger : jobId = "
+
jobInfo
.
getId
()
);
logger
.
debug
(
">>>>>>>>>>> xxl-job, schedule push trigger : jobId = "
+
jobInfo
.
getId
()
);
// 2、fresh next
// 2、fresh next
...
@@ -241,7 +241,7 @@ public class JobScheduleHelper {
...
@@ -241,7 +241,7 @@ public class JobScheduleHelper {
// do trigger
// do trigger
for
(
int
jobId:
ringItemData
)
{
for
(
int
jobId:
ringItemData
)
{
// do trigger
// do trigger
JobTriggerPoolHelper
.
trigger
(
jobId
,
TriggerTypeEnum
.
CRON
,
-
1
,
null
,
null
);
JobTriggerPoolHelper
.
trigger
(
jobId
,
TriggerTypeEnum
.
CRON
,
-
1
,
null
,
null
,
null
);
}
}
// clear
// clear
ringItemData
.
clear
();
ringItemData
.
clear
();
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobTriggerPoolHelper.java
浏览文件 @
23490980
...
@@ -69,7 +69,12 @@ public class JobTriggerPoolHelper {
...
@@ -69,7 +69,12 @@ public class JobTriggerPoolHelper {
/**
/**
* add trigger
* add trigger
*/
*/
public
void
addTrigger
(
final
int
jobId
,
final
TriggerTypeEnum
triggerType
,
final
int
failRetryCount
,
final
String
executorShardingParam
,
final
String
executorParam
)
{
public
void
addTrigger
(
final
int
jobId
,
final
TriggerTypeEnum
triggerType
,
final
int
failRetryCount
,
final
String
executorShardingParam
,
final
String
executorParam
,
final
String
addressList
)
{
// choose thread pool
// choose thread pool
ThreadPoolExecutor
triggerPool_
=
fastTriggerPool
;
ThreadPoolExecutor
triggerPool_
=
fastTriggerPool
;
...
@@ -87,7 +92,7 @@ public class JobTriggerPoolHelper {
...
@@ -87,7 +92,7 @@ public class JobTriggerPoolHelper {
try
{
try
{
// do trigger
// do trigger
XxlJobTrigger
.
trigger
(
jobId
,
triggerType
,
failRetryCount
,
executorShardingParam
,
executorParam
);
XxlJobTrigger
.
trigger
(
jobId
,
triggerType
,
failRetryCount
,
executorShardingParam
,
executorParam
,
addressList
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
}
finally
{
...
@@ -138,8 +143,8 @@ public class JobTriggerPoolHelper {
...
@@ -138,8 +143,8 @@ public class JobTriggerPoolHelper {
* null: use job param
* null: use job param
* not null: cover job param
* not null: cover job param
*/
*/
public
static
void
trigger
(
int
jobId
,
TriggerTypeEnum
triggerType
,
int
failRetryCount
,
String
executorShardingParam
,
String
executorParam
)
{
public
static
void
trigger
(
int
jobId
,
TriggerTypeEnum
triggerType
,
int
failRetryCount
,
String
executorShardingParam
,
String
executorParam
,
String
addressList
)
{
helper
.
addTrigger
(
jobId
,
triggerType
,
failRetryCount
,
executorShardingParam
,
executorParam
);
helper
.
addTrigger
(
jobId
,
triggerType
,
failRetryCount
,
executorShardingParam
,
executorParam
,
addressList
);
}
}
}
}
xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
浏览文件 @
23490980
...
@@ -37,8 +37,17 @@ public class XxlJobTrigger {
...
@@ -37,8 +37,17 @@ public class XxlJobTrigger {
* @param executorParam
* @param executorParam
* null: use job param
* null: use job param
* not null: cover job param
* not null: cover job param
* @param addressList
* null: use executor addressList
* not null: cover
*/
*/
public
static
void
trigger
(
int
jobId
,
TriggerTypeEnum
triggerType
,
int
failRetryCount
,
String
executorShardingParam
,
String
executorParam
)
{
public
static
void
trigger
(
int
jobId
,
TriggerTypeEnum
triggerType
,
int
failRetryCount
,
String
executorShardingParam
,
String
executorParam
,
String
addressList
)
{
// load data
// load data
XxlJobInfo
jobInfo
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobInfoDao
().
loadById
(
jobId
);
XxlJobInfo
jobInfo
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobInfoDao
().
loadById
(
jobId
);
if
(
jobInfo
==
null
)
{
if
(
jobInfo
==
null
)
{
...
@@ -51,6 +60,12 @@ public class XxlJobTrigger {
...
@@ -51,6 +60,12 @@ public class XxlJobTrigger {
int
finalFailRetryCount
=
failRetryCount
>=
0
?
failRetryCount:
jobInfo
.
getExecutorFailRetryCount
();
int
finalFailRetryCount
=
failRetryCount
>=
0
?
failRetryCount:
jobInfo
.
getExecutorFailRetryCount
();
XxlJobGroup
group
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobGroupDao
().
load
(
jobInfo
.
getJobGroup
());
XxlJobGroup
group
=
XxlJobAdminConfig
.
getAdminConfig
().
getXxlJobGroupDao
().
load
(
jobInfo
.
getJobGroup
());
// cover addressList
if
(
addressList
!=
null
&&
addressList
.
trim
().
length
()>
0
)
{
group
.
setAddressType
(
1
);
group
.
setAddressList
(
addressList
.
trim
());
}
// sharding param
// sharding param
int
[]
shardingParam
=
null
;
int
[]
shardingParam
=
null
;
if
(
executorShardingParam
!=
null
){
if
(
executorShardingParam
!=
null
){
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/AdminBizImpl.java
浏览文件 @
23490980
...
@@ -74,7 +74,7 @@ public class AdminBizImpl implements AdminBiz {
...
@@ -74,7 +74,7 @@ public class AdminBizImpl implements AdminBiz {
int
childJobId
=
(
childJobIds
[
i
]!=
null
&&
childJobIds
[
i
].
trim
().
length
()>
0
&&
isNumeric
(
childJobIds
[
i
]))?
Integer
.
valueOf
(
childJobIds
[
i
]):-
1
;
int
childJobId
=
(
childJobIds
[
i
]!=
null
&&
childJobIds
[
i
].
trim
().
length
()>
0
&&
isNumeric
(
childJobIds
[
i
]))?
Integer
.
valueOf
(
childJobIds
[
i
]):-
1
;
if
(
childJobId
>
0
)
{
if
(
childJobId
>
0
)
{
JobTriggerPoolHelper
.
trigger
(
childJobId
,
TriggerTypeEnum
.
PARENT
,
-
1
,
null
,
null
);
JobTriggerPoolHelper
.
trigger
(
childJobId
,
TriggerTypeEnum
.
PARENT
,
-
1
,
null
,
null
,
null
);
ReturnT
<
String
>
triggerChildResult
=
ReturnT
.
SUCCESS
;
ReturnT
<
String
>
triggerChildResult
=
ReturnT
.
SUCCESS
;
// add msg
// add msg
...
...
xxl-job-admin/src/main/resources/i18n/message_en.properties
浏览文件 @
23490980
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=Stop
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=Stop
jobinfo_opt_start
=
Start
jobinfo_opt_start
=
Start
jobinfo_opt_log
=
Query Log
jobinfo_opt_log
=
Query Log
jobinfo_opt_run
=
Run Once
jobinfo_opt_run
=
Run Once
jobinfo_opt_run_tips
=
Please input the address for this trigger. Null will be obtained from the executor
jobinfo_opt_registryinfo
=
Registry Info
jobinfo_opt_registryinfo
=
Registry Info
jobinfo_opt_next_time
=
Next trigger time
jobinfo_opt_next_time
=
Next trigger time
jobinfo_glue_remark
=
Resource Remark
jobinfo_glue_remark
=
Resource Remark
...
...
xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties
浏览文件 @
23490980
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=停止
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=停止
jobinfo_opt_start
=
启动
jobinfo_opt_start
=
启动
jobinfo_opt_log
=
查询日志
jobinfo_opt_log
=
查询日志
jobinfo_opt_run
=
执行一次
jobinfo_opt_run
=
执行一次
jobinfo_opt_run_tips
=
请输入本次执行的机器地址,为空则从执行器获取
jobinfo_opt_registryinfo
=
注册节点
jobinfo_opt_registryinfo
=
注册节点
jobinfo_opt_next_time
=
下次执行时间
jobinfo_opt_next_time
=
下次执行时间
jobinfo_glue_remark
=
源码备注
jobinfo_glue_remark
=
源码备注
...
...
xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties
浏览文件 @
23490980
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=停止
...
@@ -135,6 +135,7 @@ jobinfo_opt_stop=停止
jobinfo_opt_start
=
啟動
jobinfo_opt_start
=
啟動
jobinfo_opt_log
=
查詢日誌
jobinfo_opt_log
=
查詢日誌
jobinfo_opt_run
=
執行一次
jobinfo_opt_run
=
執行一次
jobinfo_opt_run_tips
=
請輸入本次執行的機器地址,為空則從執行器獲取
jobinfo_opt_registryinfo
=
注冊節點
jobinfo_opt_registryinfo
=
注冊節點
jobinfo_opt_next_time
=
下次執行時間
jobinfo_opt_next_time
=
下次執行時間
jobinfo_glue_remark
=
源碼備註
jobinfo_glue_remark
=
源碼備註
...
...
xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
浏览文件 @
23490980
...
@@ -262,7 +262,8 @@ $(function() {
...
@@ -262,7 +262,8 @@ $(function() {
url
:
base_url
+
"/jobinfo/trigger"
,
url
:
base_url
+
"/jobinfo/trigger"
,
data
:
{
data
:
{
"id"
:
$
(
"#jobTriggerModal .form input[name='id']"
).
val
(),
"id"
:
$
(
"#jobTriggerModal .form input[name='id']"
).
val
(),
"executorParam"
:
$
(
"#jobTriggerModal .textarea[name='executorParam']"
).
val
()
"executorParam"
:
$
(
"#jobTriggerModal .textarea[name='executorParam']"
).
val
(),
"addressList"
:
$
(
"#jobTriggerModal .textarea[name='addressList']"
).
val
()
},
},
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
data
){
success
:
function
(
data
){
...
...
xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
浏览文件 @
23490980
...
@@ -407,6 +407,12 @@ exit 0
...
@@ -407,6 +407,12 @@ exit 0
<textarea
class=
"textarea form-control"
name=
"executorParam"
placeholder=
"${I18n.system_please_input}${I18n.jobinfo_field_executorparam}"
maxlength=
"512"
style=
"height: 63px; line-height: 1.2;"
></textarea>
<textarea
class=
"textarea form-control"
name=
"executorParam"
placeholder=
"${I18n.system_please_input}${I18n.jobinfo_field_executorparam}"
maxlength=
"512"
style=
"height: 63px; line-height: 1.2;"
></textarea>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"firstname"
class=
"col-sm-2 control-label"
>
${I18n.jobgroup_field_registryList}
<font
color=
"black"
>
*
</font></label>
<div
class=
"col-sm-10"
>
<textarea
class=
"textarea form-control"
name=
"addressList"
placeholder=
"${I18n.jobinfo_opt_run_tips}"
maxlength=
"512"
style=
"height: 63px; line-height: 1.2;"
></textarea>
</div>
</div>
<hr>
<hr>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-offset-3 col-sm-6"
>
<div
class=
"col-sm-offset-3 col-sm-6"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论