Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Jun 8, 2017
1 parent 742fdd7 commit 67979f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
6 changes: 3 additions & 3 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

### 功能提升

1. [ISSUE #352](https://github.com/dangdangdotcom/elastic-job/issues/352) Cloud作业本地运行
1. [ISSUE #352](https://github.com/dangdangdotcom/elastic-job/issues/352) elastic-job-cloud-executor本地运行模式

### 缺陷修正

1. [ISSUE #322](https://github.com/dangdangdotcom/elastic-job/issues/322) elastic-job-cloud-scheduler调度任务评估资源时考虑对executor的资源使用情况
1. [ISSUE #341](https://github.com/dangdangdotcom/elastic-job/issues/341) elastic-job-cloud界面script作业配置缺少执行脚本
1. [ISSUE #343](https://github.com/dangdangdotcom/elastic-job/issues/343) elastic-job-cloud中Script类型作业执行脚本不正确
1. [ISSUE #341](https://github.com/dangdangdotcom/elastic-job/issues/341) elastic-job-cloud-console中script作业配置缺少执行脚本
1. [ISSUE #343](https://github.com/dangdangdotcom/elastic-job/issues/343) elastic-job-cloud-console中Script类型作业执行脚本不正确
1. [ISSUE #345](https://github.com/dangdangdotcom/elastic-job/issues/345) elastic-job-lite-console任务全部禁用时状态显示不正确
1. [ISSUE #351](https://github.com/dangdangdotcom/elastic-job/issues/351) elastic-job-lite-console管理后台添加注册中心,登录凭证栏无法输入‘:‘

Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
+++
toc = true
date = "2017-06-05T16:14:21+08:00"
title = "本地运行作业"
title = "本地运行模式"
weight = 40
prev = "/02-guide/event-trace/"
next = "/03-design"
+++

在开发`Elastic-Job-Cloud`作业的时候,开发人员会希望能够本地运行作业。目前作业云提供了该功能,您只需要使用简单的API配置作业,就可以像在
`Mesos`集群中一样本地运行作业。
在开发`Elastic-Job-Cloud`作业时,开发人员可以脱离`Mesos`环境,在本地运行和调试作业。可以利用本地运行模式充分的调试业务功能以及单元测试,完成之后再部署至`Mesos`集群。

本地运行作业无需安装`Mesos`环境。

## 本地作业配置
## 配置

使用`com.dangdang.ddframe.job.cloud.executor.local.LocalCloudJobConfiguration`来配置本地作业
使用`com.dangdang.ddframe.job.cloud.executor.local.LocalCloudJobConfiguration`配置本地作业

```java
LocalCloudJobConfiguration config = new LocalCloudJobConfiguration(
new SimpleJobConfiguration(JobCoreConfiguration.newBuilder("FooJob", "*/2 * * * * ?", 3) //1
.shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou")
.jobParameter("dbName=dangdang").build()
, "com.dangdang.foo.FooJob")
, LocalCloudJobExecutionType.DAEMON //2
, 1 //3
, "testSimpleJob" //4
, "applicationContext.xml")
.jobParameter("dbName=dangdang").build(), "com.dangdang.foo.FooJob"),
1, //2
"testSimpleJob" , "applicationContext.xml"); //3
```

1. 配置作业类型和作业基本信息。
1. 配置作业的执行类型。
1. 配置当前运行的作业是第几个分片。
1. 配置Spring相关参数。

## 运行本地作业
## 运行

使用`com.dangdang.ddframe.job.cloud.executor.local.LocalTaskExecutor`运行作业。

```java
new LocalTaskExecutor(config).execute();
```
new LocalTaskExecutor(localJobConfig).execute();
```

0 comments on commit 67979f9

Please sign in to comment.