Skip to content

Commit

Permalink
Support building and using ElasticJob with JDK23
Browse files Browse the repository at this point in the history
  • Loading branch information
linghengqian committed Oct 27, 2024
1 parent b03ad56 commit adda4b8
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: github.repository == 'apache/shardingsphere-elasticjob'
strategy:
matrix:
java: [ 8, 17, 21, 22 ]
java: [ 8, 17, 21, 23 ]
os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
38 changes: 19 additions & 19 deletions docs/content/user-manual/usage/operation-api/_index.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 获取作业配置

方法签名:YamlJobConfiguration getJobConfiguration(String jobName)
方法签名:`JobConfigurationPOJO getJobConfiguration(String jobName)`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -31,14 +31,14 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 更新作业配置

方法签名:void updateJobConfiguration(YamlJobConfiguration yamlJobConfiguration)
方法签名:`void updateJobConfiguration(JobConfigurationPOJO jobConfig)`

* **Parameters:**
* jobConfiguration — 作业配置对象
* jobConfig — 作业配置对象

### 删除作业设置

方法签名:void removeJobConfiguration(String jobName)
方法签名:`void removeJobConfiguration(String jobName)`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -51,7 +51,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

作业在不与当前运行中作业冲突的情况下才会触发执行,并在启动后自动清理此标记。

方法签名:void trigger(Optional<String> jobName)
方法签名:`void trigger(String jobName)`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -60,39 +60,39 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

禁用作业将会导致分布式的其他作业触发重新分片。

方法签名:void disable(Optional<String> jobName, Optional<String> serverIp)
方法签名:`void disable(String jobName, String serverIp)`

* **Parameters:**
* jobName — 作业名称
* serverIp — 作业服务器 IP 地址

### 启用作业

方法签名:void enable(Optional<String> jobName, Optional<String> serverIp)
方法签名:`void enable(String jobName, String serverIp)`

* **Parameters:**
* jobName — 作业名称
* serverIp — 作业服务器 IP 地址

### 停止调度作业

方法签名:void shutdown(Optional<String> jobName, Optional<String> serverIp)
方法签名:`void shutdown(String jobName, String serverIp)`

* **Parameters:**
* jobName — 作业名称
* serverIp — 作业服务器IP地址

### 删除作业

方法签名:void remove(Optional<String> jobName, Optional<String> serverIp)
方法签名:`void remove(String jobName, String serverIp)`

* **Parameters:**
* jobName — 作业名称
* serverIp — 作业服务器IP地址

### Dump 作业

方法签名:String dump(String jobName, String instanceIp, int dumpPort)
方法签名:`String dump(String jobName, String instanceIp, int dumpPort) throws IOException`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -105,15 +105,15 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 禁用作业分片

方法签名:void disable(String jobName, String item)
方法签名:`void disable(String jobName, String item)`

* **Parameters:**
* jobName — 作业名称
* item — 作业分片项

### 启用作业分片

方法签名:void enable(String jobName, String item)
方法签名:`void enable(String jobName, String item)`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -125,13 +125,13 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 获取作业总数

方法签名:int getJobsTotalCount()
方法签名:`int getJobsTotalCount()`

* **Returns:** 作业总数

### 获取作业简明信息

方法签名:JobBriefInfo getJobBriefInfo(String jobName)
方法签名:`JobBriefInfo getJobBriefInfo(String jobName)`

* **Parameters:**
* jobName — 作业名称
Expand All @@ -140,13 +140,13 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 获取所有作业简明信息

方法签名:Collection<JobBriefInfo> getAllJobsBriefInfo()
方法签名:`Collection<JobBriefInfo> getAllJobsBriefInfo()`

* **Returns:** 作业简明信息集合

### 获取该 IP 下所有作业简明信息

方法签名:Collection<JobBriefInfo> getJobsBriefInfo(String ip)
方法签名:`Collection<JobBriefInfo> getJobsBriefInfo(String ip)`

* **Parameters:**
* ip — 服务器 IP
Expand All @@ -159,13 +159,13 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 获取作业服务器总数

方法签名:int getServersTotalCount()
方法签名:`int getServersTotalCount()`

* **Returns:** 作业服务器总数

### 获取所有作业服务器简明信息

方法签名:Collection<ServerBriefInfo> getAllServersBriefInfo()
方法签名:`Collection<ServerBriefInfo> getAllServersBriefInfo()`

* **Returns:** 作业服务器简明信息集合

Expand All @@ -175,7 +175,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的

### 获取作业分片信息集合

方法签名:Collection<ShardingInfo> getShardingInfo(String jobName)
方法签名:`Collection<ShardingInfo> getShardingInfo(String jobName)`

* **Parameters:**
* jobName — 作业名称
Expand Down
38 changes: 19 additions & 19 deletions docs/content/user-manual/usage/operation-api/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Class name: `org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfiguration

### Get job configuration

Method signature:YamlJobConfiguration getJobConfiguration(String jobName)
Method signature:`JobConfigurationPOJO getJobConfiguration(String jobName)`

* **Parameters:**
* jobName — Job name
Expand All @@ -31,14 +31,14 @@ Method signature:YamlJobConfiguration getJobConfiguration(String jobName)

### Update job configuration

Method signature:void updateJobConfiguration(YamlJobConfiguration yamlJobConfiguration)
Method signature:`void updateJobConfiguration(JobConfigurationPOJO jobConfig)`

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

### Remove job configuration

Method signature:void removeJobConfiguration(String jobName)
Method signature:`void removeJobConfiguration(String jobName)`

* **Parameters:**
* jobName — Job name
Expand All @@ -51,7 +51,7 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI`

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)
Method signature:`void trigger(String jobName)`

* **Parameters:**
* jobName — Job name
Expand All @@ -60,39 +60,39 @@ Method signature:void trigger(Optional<String> jobName)

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

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

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

### Enable job

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

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

### Shutdown scheduling job

Method signature:void shutdown(Optional<String> jobName, Optional<String> serverIp)
Method signature:`void shutdown(String jobName, 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)
Method signature:`void remove(String jobName, String serverIp)`

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

### Dump job

Method signature:String dump(String jobName, String instanceIp, int dumpPort)
Method signature:`String dump(String jobName, String instanceIp, int dumpPort) throws IOException`

* **Parameters:**
* jobName — Job name
Expand All @@ -105,15 +105,15 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperate

### Disable job sharding

Method signature:void disable(String jobName, String item)
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)
Method signature:`void enable(String jobName, String item)`

* **Parameters:**
* jobName — Job name
Expand All @@ -125,13 +125,13 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAP

### Get the total count of jobs

Method signature:int getJobsTotalCount()
Method signature:`int getJobsTotalCount()`

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

### Get brief job information

Method signature:JobBriefInfo getJobBriefInfo(String jobName)
Method signature:`JobBriefInfo getJobBriefInfo(String jobName)`

* **Parameters:**
* jobName — Job name
Expand All @@ -140,13 +140,13 @@ Method signature:JobBriefInfo getJobBriefInfo(String jobName)

### Get brief information about all jobs.

Method signature:Collection<JobBriefInfo> getAllJobsBriefInfo()
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)
Method signature:`Collection<JobBriefInfo> getJobsBriefInfo(String ip)`

* **Parameters:**
* ip — server IP
Expand All @@ -159,13 +159,13 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatistic

### Total count of job servers

Method signature:int getServersTotalCount()
Method signature:`int getServersTotalCount()`

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

### Get brief information about all job servers

Method signature:Collection<ServerBriefInfo> getAllServersBriefInfo()
Method signature:`Collection<ServerBriefInfo> getAllServersBriefInfo()`

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

Expand All @@ -175,7 +175,7 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatist

### Get job sharding information collection

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

* **Parameters:**
* jobName — Job name
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<hikari-cp.version>4.0.3</hikari-cp.version>

<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<flatten-maven-plugin.version>1.2.5</flatten-maven-plugin.version>
</properties>

Expand Down
13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@

<quartz.version>2.3.2</quartz.version>

<zookeeper.version>3.9.2</zookeeper.version>
<curator.version>5.7.0</curator.version>
<zookeeper.version>3.9.3</zookeeper.version>
<curator.version>5.7.1</curator.version>

<mail.version>1.6.0</mail.version>
<commons-codec.version>1.16.0</commons-codec.version>
Expand Down Expand Up @@ -97,7 +97,7 @@

<!-- Compile plugin versions -->
<maven-enforcer-plugin.version>3.2.1</maven-enforcer-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
Expand Down Expand Up @@ -433,6 +433,13 @@
<target>${java.version}</target>
<testSource>${java.version}</testSource>
<testTarget>${java.version}</testTarget>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand Down
Loading

0 comments on commit adda4b8

Please sign in to comment.