Authored by Gino Zhang

更新KisJob日志信息

... ... @@ -2,6 +2,7 @@ package com.yoho.kisjob.common.constant;
/**
* 任务异常
*
* @author zhangfeng
* @since 2016-07-13
*/
... ... @@ -11,7 +12,9 @@ public class JobException extends RuntimeException {
/**
* 支持错误码的异常 暂不启动
* @param errorCode 错误码
*
* @param errorCode
* 错误码
*/
@Deprecated
public JobException(int errorCode) {
... ...
... ... @@ -103,7 +103,7 @@ public class DistributedJob extends AbstractJob {
// 处理节点不可用的情况
// TODO:处理失效转移的情况 暂时先不支持 都设置为失败
registerCenter.endExecuteGroup(jobInstId, meta.getGroupIndex(), new JobException(
"The job node is unavailable."));
"The job node %s is unavailable.", meta.getNodeIdentifier()));
}
}
}
... ... @@ -157,19 +157,19 @@ public class DistributedJob extends AbstractJob {
@Override
public void pause() {
//TODO:支持暂停、恢复和取消
// TODO:支持暂停、恢复和取消
super.pause();
}
@Override
public void resume() {
//TODO:支持暂停、恢复和取消
// TODO:支持暂停、恢复和取消
super.resume();
}
@Override
public void cancel() {
//TODO:支持暂停、恢复和取消
// TODO:支持暂停、恢复和取消
super.cancel();
}
}
... ...
... ... @@ -15,7 +15,7 @@ public class TestBaseJob extends AbstractJob {
@Override
public void execute() {
log.debug("Hello world. " + new Date() + " JobName: " + JobContextHolder.getContext().getJobName());
log.info("Hello world. " + new Date() + " JobName: " + JobContextHolder.getContext().getJobName());
}
}
... ...
... ... @@ -26,5 +26,4 @@ public class TestMapper implements Mapper {
}
log.debug("End to map.");
}
}
... ...
... ... @@ -10,26 +10,14 @@
http://vm.yoho.com/schema/kisjob/job/job.xsd
">
<context:component-scan base-package="com.yoho.kisjob" />
<context:component-scan base-package="com.yoho.kisjob.demo" />
<job:define id="jobDemo1" job-type="clusterJob" job-ref="testBaseJob">
<job:timer job-run-type="realtime" />
</job:define>
<job:define id="jobDemo2" job-type="singleJob" job-ref="testBaseJob">
<job:timer job-run-type="onetime" run-time="2018-01-01 00:00:00" />
</job:define>
<job:define id="jobDemo11" job-type="clusterJob" job-ref="testBaseJob">
<job:timer job-run-type="cron" cron="0 * * * * ?" />
</job:define>
<job:define id="jobDemo12" job-type="singleJob" job-ref="testBaseJob">
<job:define id="jobDemo1" job-type="singleJob" job-ref="testBaseJob">
<job:timer job-run-type="cron" cron="20 * * * * ?" />
</job:define>
<job:define id="jobDemo13" job-type="elastaicJob"
mapper-ref="testMapper" executor-ref="testExecutor">
<job:define id="jobDemo2" job-type="elastaicJob" mapper-ref="testMapper"
executor-ref="testExecutor">
<job:param name="param1" value="value1" />
<job:param name="param2" value="value2" />
<job:timer job-run-type="cron" cron="40 * * * * ?" />
... ...