Skip to content

Commit

Permalink
Fix bug at mr for 1165 (#1170)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyuguang committed Jul 19, 2020
1 parent f5a2790 commit 1cd3a82
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 111 deletions.
110 changes: 1 addition & 109 deletions docs/content/user-manual/elasticjob-lite/configuration/java-api.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,112 +4,4 @@ weight = 1
chapter = true
+++

## Java API(Incubating)

### 1. Configuration API

#### `JobConfigurationAPI` API for job configuration

##### YamlJobConfiguration getJobConfiguration(String jobName) Get job settings.

* **Parameters:** jobName — Job name

* **Returns:** Job Setting Object

##### void updateJobConfiguration(YamlJobConfiguration yamlJobConfiguration) Update job settings.

* **Parameters:** jobConfiguration — job setting object

##### void removeJobConfiguration(String jobName) Delete job settings.

* **Parameters:** jobName — Job name

### 2. Operation API

#### 2.1 `JobOperateAPI` API for operating jobs

##### void trigger(Optional<String> jobName, Optional<String> serverIp) The job is executed immediately. The job will only be started if it does not conflict with the last running job, and this flag will be automatically cleared after startup.

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

##### void disable(Optional<String> jobName, Optional<String> serverIp) The job disable. It will be fragmented again.

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

##### void enable(Optional<String> jobName, Optional<String> serverIp) The job enable.

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

##### void shutdown(Optional<String> jobName, Optional<String> serverIp) The job shutdown.

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

##### void remove(Optional<String> jobName, Optional<String> serverIp) The job remove.

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

#### 2.2 `ShardingOperateAPI` API for operating sharding

##### void disable(String jobName, String item) Disable the job sharding.

* **Parameters:**
* jobName — Job name
* item — Job sharding item

##### void enable(String jobName, String item) Enable the job sharding.

* **Parameters:**
* jobName — Job name
* item — Job sharding item

### 3. Statistics API

#### 3.1 `JobStatisticsAPI` API for displaying job status

##### int getJobsTotalCount() Get the total count of jobs.

* **Returns:** Total count of jobs

##### JobBriefInfo getJobBriefInfo(String jobName) Get brief job information.

* **Parameters:** jobName — Job name

* **Returns:** The brief job information

##### Collection<JobBriefInfo> getAllJobsBriefInfo() Get brief information about all jobs.

* **Returns:** Brief collection of all job information

##### Collection<JobBriefInfo> getJobsBriefInfo(String ip) Get brief information of all jobs under this IP.

* **Parameters:** ip — The Server IP

* **Returns:** Brief collection of job information

#### 3.2 `ServerStatisticsAPI` API for displaying job server status

##### int getServersTotalCount() Get the total count of job servers.

* **Returns:** Total count of job servers.

##### Collection<ServerBriefInfo> getAllServersBriefInfo() Get brief information of all job servers.

* **Returns:** Brief collection of job server information

#### 3.3 `ShardingStatisticsAPI` API for displaying job sharding status

##### Collection<ShardingInfo> getShardingInfo(String jobName) Get job sharding information collection.

* **Parameters:** jobName — Job name

* **Returns:** The collection of job sharding information
TODO
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操

类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI`

### 获取作业配置
### 获取作业配置

方法签名:YamlJobConfiguration getJobConfiguration(String jobName)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,164 @@ weight = 4
chapter = true
+++

TODO
ElasticJob-Lite provides a Java API, which can control the life cycle of jobs in a distributed environment by directly operating the registry.

The module is still in incubation.

## Configuration API

Class name: `org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI`

### Get job configuration

Method signature:YamlJobConfiguration getJobConfiguration(String jobName)

* **Parameters:**
* jobName — Job name

* **Returns:** Job configuration object

### Update job configuration

Method signature:void updateJobConfiguration(YamlJobConfiguration yamlJobConfiguration)

* **Parameters:**
* jobConfiguration — Job configuration object

### Remove job configuration

Method signature:void removeJobConfiguration(String jobName)

* **Parameters:**
* jobName — Job name

## Operation API

Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI`

### Trigger job execution

The job will only trigger execution if it does not conflict with the currently running job, and this flag will be automatically cleared after it is started.

Method signature:void trigger(Optional<String> jobName, Optional<String> serverIp)

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

### Disable job

Disabling a job will cause other distributed jobs to trigger resharding.

Method signature:void disable(Optional<String> jobName, Optional<String> serverIp)

* **Parameters:**
* jobName — Job name
* serverIp — job server IP address

### Enable job

Method signature:void enable(Optional<String> jobName, Optional<String> serverIp)

* **Parameters:**
* jobName — Job name
* serverIp — job server IP address

### Shutdown scheduling job

Method signature:void shutdown(Optional<String> jobName, Optional<String> serverIp)

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

### Remove job

Method signature:void remove(Optional<String> jobName, Optional<String> serverIp)

* **Parameters:**
* jobName — Job name
* serverIp — IP address of the job server

## Operate sharding API

Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI`

### Disable job sharding

Method signature:void disable(String jobName, String item)

* **Parameters:**
* jobName — Job name
* item — Job sharding item

### Enable job sharding

Method signature:void enable(String jobName, String item)

* **Parameters:**
* jobName — Job name
* item — Job sharding item

## Job statistics API

Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI`

### Get the total count of jobs

Method signature:int getJobsTotalCount()

* **Returns:** the total count of jobs

### Get brief job information

Method signature:JobBriefInfo getJobBriefInfo(String jobName)

* **Parameters:**
* jobName — Job name

* **Returns:** The brief job information

### Get brief information about all jobs.

Method signature:Collection<JobBriefInfo> getAllJobsBriefInfo()

* **Returns:** Brief collection of all job information

### Get brief information of all jobs under this IP

Method signature:Collection<JobBriefInfo> getJobsBriefInfo(String ip)

* **Parameters:**
* ip — server IP

* **Returns:** Brief collection of job information

## Job server status display API

Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI`

### Total count of job servers

Method signature:int getServersTotalCount()

* **Returns:** Get the total count of job servers

### Get brief information about all job servers

Method signature:Collection<ServerBriefInfo> getAllServersBriefInfo()

* **Returns:** Brief collection of job information

## Job sharding status display API

Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI`

### Get job sharding information collection

Method signature:Collection<ShardingInfo> getShardingInfo(String jobName)

* **Parameters:**
* jobName — Job name

* **Returns:** The collection of job sharding information

0 comments on commit 1cd3a82

Please sign in to comment.