Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
177ab8d2
提交
177ab8d2
authored
3月 12, 2017
作者:
xueli.xue
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
执行器策略推送
上级
6169ac54
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
32 行增加
和
25 行删除
+32
-25
README.md
README.md
+1
-1
tables_xxl_job.sql
db/tables_xxl_job.sql
+1
-1
RemoteHttpJobBean.java
...ava/com/xxl/job/admin/core/jobbean/RemoteHttpJobBean.java
+0
-0
ExecutorRouteRandom.java
...xl/job/admin/core/route/strategy/ExecutorRouteRandom.java
+1
-0
IXxlJobLogDao.java
...in/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java
+2
-0
XxlJobLogDaoImpl.java
...ain/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java
+0
-0
XxlJobLogMapper.xml
...min/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml
+2
-8
joblog.index.ftl
.../src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl
+3
-3
jobinfo.index.1.js
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
+1
-1
joblog.index.1.js
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
+11
-10
HttpClientUtil.java
...e/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
+10
-1
没有找到文件。
README.md
浏览文件 @
177ab8d2
...
...
@@ -737,7 +737,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
3、CleanCode,清理无效的历史参数;
-
4、规范系统配置数据,通过配置文件统一管理;
-
5、执行器支持手动设置执行地址列表,提供开关切换使用注册地址还是手动设置的地址;
-
6、执行器路由规则:第一个、
循环、随机、顺序故障(默认)
转移;
-
6、执行器路由规则:第一个、
最后一个、轮询、随机、一致性HASH、最不经常使用、最近最久未使用、故障
转移;
-
7、底层扩展数据接口调整;
-
8、新建任务默认为非运行状态;
...
...
db/tables_xxl_job.sql
浏览文件 @
177ab8d2
...
...
@@ -154,7 +154,7 @@ CREATE TABLE `XXL_JOB_QRTZ_TRIGGER_INFO` (
`update_time`
datetime
DEFAULT
NULL
,
`author`
varchar
(
64
)
DEFAULT
NULL
COMMENT
'作者'
,
`alarm_email`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'报警邮件'
,
`executor_route_strategy`
varchar
(
2
0
)
DEFAULT
NULL
COMMENT
'执行器路由策略'
,
`executor_route_strategy`
varchar
(
5
0
)
DEFAULT
NULL
COMMENT
'执行器路由策略'
,
`executor_handler`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'执行器任务handler'
,
`executor_param`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'执行器任务参数'
,
`glue_switch`
int
(
11
)
DEFAULT
'0'
COMMENT
'GLUE模式开关:0-否,1-是'
,
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/jobbean/RemoteHttpJobBean.java
浏览文件 @
177ab8d2
差异被折叠。
点击展开。
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteRandom.java
浏览文件 @
177ab8d2
...
...
@@ -14,6 +14,7 @@ public class ExecutorRouteRandom extends ExecutorRouter {
@Override
public
String
route
(
int
jobId
,
ArrayList
<
String
>
addressList
)
{
// Collections.shuffle(addressList);
return
addressList
.
get
(
localRandom
.
nextInt
(
addressList
.
size
()));
}
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/IXxlJobLogDao.java
浏览文件 @
177ab8d2
...
...
@@ -17,7 +17,9 @@ public interface IXxlJobLogDao {
public
XxlJobLog
load
(
int
id
);
public
int
save
(
XxlJobLog
xxlJobLog
);
public
int
updateTriggerInfo
(
XxlJobLog
xxlJobLog
);
public
int
updateHandleInfo
(
XxlJobLog
xxlJobLog
);
public
int
delete
(
int
jobId
);
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/dao/impl/XxlJobLogDaoImpl.java
浏览文件 @
177ab8d2
xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobLogMapper.xml
浏览文件 @
177ab8d2
...
...
@@ -88,16 +88,10 @@
<insert
id=
"save"
parameterType=
"com.xxl.job.admin.core.model.XxlJobLog"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO XXL_JOB_QRTZ_TRIGGER_LOG (
`job_group`,
`job_id`,
`executor_address`,
`executor_handler`,
`executor_param`
`job_id`
) VALUES (
#{jobGroup},
#{jobId},
#{executorAddress},
#{executorHandler},
#{executorParam}
#{jobId}
);
<selectKey
resultType=
"java.lang.Integer"
order=
"AFTER"
keyProperty=
"id"
>
SELECT LAST_INSERT_ID()
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl
浏览文件 @
177ab8d2
...
...
@@ -78,12 +78,12 @@
<th
name=
"id"
>
id
</th>
<th
name=
"jobGroup"
>
执行器ID
</th>
<th
name=
"jobId"
>
任务ID
</th>
<th
name=
"executorAddress"
>
执行器地址
</th>
<th
name=
"executorHandler"
>
JobHandler
</th>
<th
name=
"executorParam"
>
任务参数
</th>
<th
name=
"triggerTime"
>
调度时间
</th>
<th
name=
"triggerCode"
>
调度结果
</th>
<th
name=
"triggerMsg"
>
调度备注
</th>
<th
name=
"executorAddress"
>
执行器地址
</th>
<th
name=
"executorHandler"
>
JobHandler
</th>
<th
name=
"executorParam"
>
任务参数
</th>
<th
name=
"handleTime"
>
执行时间
</th>
<th
name=
"handleCode"
>
执行结果
</th>
<th
name=
"handleMsg"
>
执行备注
</th>
...
...
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
浏览文件 @
177ab8d2
...
...
@@ -138,7 +138,7 @@ $(function() {
"sProcessing"
:
"处理中..."
,
"sLengthMenu"
:
"每页 _MENU_ 条记录"
,
"sZeroRecords"
:
"没有匹配结果"
,
"sInfo"
:
"第 _PAGE_ 页 ( 总共 _PAGES_ 页 )"
,
"sInfo"
:
"第 _PAGE_ 页 ( 总共 _PAGES_ 页
,_TOTAL_ 条记录
)"
,
"sInfoEmpty"
:
"无记录"
,
"sInfoFiltered"
:
"(由 _MAX_ 项结果过滤)"
,
"sInfoPostFix"
:
""
,
...
...
xxl-job-admin/src/main/webapp/static/js/joblog.index.1.js
浏览文件 @
177ab8d2
...
...
@@ -81,15 +81,6 @@ $(function() {
{
"data"
:
'id'
,
"bSortable"
:
false
,
"visible"
:
false
},
{
"data"
:
'jobGroup'
,
"visible"
:
false
},
{
"data"
:
'jobId'
,
"visible"
:
false
},
{
"data"
:
'executorAddress'
,
"visible"
:
true
},
{
"data"
:
'executorHandler'
,
"visible"
:
true
,
"render"
:
function
(
data
,
type
,
row
)
{
return
(
row
.
executorHandler
)?
row
.
executorHandler
:
"GLUE模式"
;
}
},
{
"data"
:
'executorParam'
,
"visible"
:
true
},
{
"data"
:
'triggerTime'
,
"render"
:
function
(
data
,
type
,
row
)
{
...
...
@@ -109,6 +100,16 @@ $(function() {
return
data
?
'<a class="logTips" href="javascript:;" >查看<span style="display:none;">'
+
data
+
'</span></a>'
:
"无"
;
}
},
{
"data"
:
'executorAddress'
,
"visible"
:
true
},
{
"data"
:
'executorHandler'
,
"visible"
:
true
,
"render"
:
function
(
data
,
type
,
row
)
{
return
(
row
.
executorHandler
)?
row
.
executorHandler
:
"GLUE模式"
;
}
},
{
"data"
:
'executorParam'
,
"visible"
:
true
},
{
"data"
:
'handleTime'
,
"render"
:
function
(
data
,
type
,
row
)
{
...
...
@@ -147,7 +148,7 @@ $(function() {
"sProcessing"
:
"处理中..."
,
"sLengthMenu"
:
"每页 _MENU_ 条记录"
,
"sZeroRecords"
:
"没有匹配结果"
,
"sInfo"
:
"第 _PAGE_ 页 ( 总共 _PAGES_ 页 )"
,
"sInfo"
:
"第 _PAGE_ 页 ( 总共 _PAGES_ 页
,_TOTAL_ 条记录
)"
,
"sInfoEmpty"
:
"无记录"
,
"sInfoFiltered"
:
"(由 _MAX_ 项结果过滤)"
,
"sInfoPostFix"
:
""
,
...
...
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
浏览文件 @
177ab8d2
package
com
.
xxl
.
job
.
core
.
util
;
import
com.xxl.job.core.rpc.codec.RpcResponse
;
import
com.xxl.job.core.rpc.serialize.HessianSerializer
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.HttpPost
;
...
...
@@ -8,6 +10,8 @@ import org.apache.http.entity.ContentType;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
...
...
@@ -18,6 +22,7 @@ import java.io.InputStream;
* @author xuxueli 2015-10-31 19:50:41
*/
public
class
HttpClientUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
HttpClientUtil
.
class
);
/**
* post request
...
...
@@ -47,7 +52,11 @@ public class HttpClientUtil {
EntityUtils
.
consume
(
entity
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
logger
.
error
(
""
,
e
);
RpcResponse
rpcResponse
=
new
RpcResponse
();
rpcResponse
.
setError
(
e
.
getMessage
());
responseBytes
=
HessianSerializer
.
serialize
(
rpcResponse
);
}
finally
{
httpPost
.
releaseConnection
();
try
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论