From 51a7d41d8969b29baeb7d73f0f715cf26d355c59 Mon Sep 17 00:00:00 2001 From: Ponfee Date: Thu, 4 Apr 2024 12:19:32 +0800 Subject: [PATCH] upgrade jar version --- disjob-admin/pom.xml | 2 +- .../src/main/java/cn/ponfee/disjob/core/base/Server.java | 2 ++ .../main/java/cn/ponfee/disjob/core/base/Supervisor.java | 3 +-- .../cn/ponfee/disjob/core/base/SupervisorRpcService.java | 9 +++++++-- .../src/main/java/cn/ponfee/disjob/core/base/Worker.java | 3 +-- .../disjob/dispatch/redis/RedisTaskDispatcher.java | 3 ++- disjob-registry/disjob-registry-nacos/pom.xml | 2 +- .../disjob/supervisor/SpringBootTestCollector.java | 3 ++- disjob-supervisor/src/test/resources/application.yml | 3 ++- pom.xml | 6 +++--- 10 files changed, 22 insertions(+), 14 deletions(-) diff --git a/disjob-admin/pom.xml b/disjob-admin/pom.xml index a78eb52b7..50fb81674 100644 --- a/disjob-admin/pom.xml +++ b/disjob-admin/pom.xml @@ -43,7 +43,7 @@ 1.4.7 1.2.83 6.5.0 - 2.15.1 + 2.16.0 5.2.5 2.3 1.8.0 diff --git a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Server.java b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Server.java index 1fa3742b0..8a2c07ad0 100644 --- a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Server.java +++ b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Server.java @@ -43,6 +43,8 @@ public abstract class Server implements Serializable { protected Server(String host, int port) { Assert.isTrue(!host.contains(Str.COLON), "Host cannot contains symbol ':'"); + // -1 for test case + Assert.isTrue(-1 <= port && port <= 65535, "Port must be range [-1, 65535]."); this.host = host; this.port = port; } diff --git a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Supervisor.java b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Supervisor.java index ee43f8c0a..d121a29f6 100644 --- a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Supervisor.java +++ b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Supervisor.java @@ -51,7 +51,6 @@ public class Supervisor extends Server { public Supervisor(String host, int port) { super(host, port); - Assert.isTrue(!host.contains(COLON), "Host cannot contains symbol ':'"); this.serializedValue = host + COLON + port; } @@ -127,7 +126,7 @@ public Supervisor deserialize(JsonParser p, DeserializationContext ctx) throws I } } - // -------------------------------------------------------------------------------class + // -------------------------------------------------------------------------------current Supervisor /** * Supervisor.class.getDeclaredClasses()[0] diff --git a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/SupervisorRpcService.java b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/SupervisorRpcService.java index 07ceeb1d4..0958cc7f2 100644 --- a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/SupervisorRpcService.java +++ b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/SupervisorRpcService.java @@ -74,8 +74,13 @@ public interface SupervisorRpcService { @PostMapping("/publish") void publish(EventParam param); - // ---------------------------------------------------------------------------savepoint - + /** + * Savepoint the task execution snapshot data + * + * @param taskId the taskId + * @param executeSnapshot the execution snapshot data + * @throws Exception if occur exception + */ @PostMapping("/task/savepoint") void savepoint(long taskId, String executeSnapshot) throws Exception; diff --git a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Worker.java b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Worker.java index 5690e4331..c08297ab6 100644 --- a/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Worker.java +++ b/disjob-core/src/main/java/cn/ponfee/disjob/core/base/Worker.java @@ -81,7 +81,6 @@ public Worker(String group, String workerId, String host, int port) { Assert.isTrue(!group.contains(COLON), "Group cannot contains symbol ':'"); Assert.isTrue(!workerId.contains(COLON), "Worker id cannot contains symbol ':'"); - Assert.isTrue(!host.contains(COLON), "Host cannot contains symbol ':'"); this.group = Strings.requireNonBlank(group.trim()); this.workerId = workerId; @@ -205,7 +204,7 @@ public Worker deserialize(JsonParser p, DeserializationContext ctx) throws IOExc } } - // -------------------------------------------------------------------------------class + // -------------------------------------------------------------------------------current Worker public abstract static class Current extends Worker { private static final long serialVersionUID = -480329874106279202L; diff --git a/disjob-dispatch/disjob-dispatch-redis/src/main/java/cn/ponfee/disjob/dispatch/redis/RedisTaskDispatcher.java b/disjob-dispatch/disjob-dispatch-redis/src/main/java/cn/ponfee/disjob/dispatch/redis/RedisTaskDispatcher.java index 37251f660..2d1d338e2 100644 --- a/disjob-dispatch/disjob-dispatch-redis/src/main/java/cn/ponfee/disjob/dispatch/redis/RedisTaskDispatcher.java +++ b/disjob-dispatch/disjob-dispatch-redis/src/main/java/cn/ponfee/disjob/dispatch/redis/RedisTaskDispatcher.java @@ -66,7 +66,8 @@ protected final boolean doDispatch(ExecuteTaskParam param) { Long ret = redisTemplate.execute((RedisCallback) conn -> conn.rPush(key.getBytes(), param.serialize())); // renew redis key ttl - workerRenewMap.computeIfAbsent(key, k -> new RedisKeyRenewal(redisTemplate, key)).renewIfNecessary(); + workerRenewMap.computeIfAbsent(key, k -> new RedisKeyRenewal(redisTemplate, key)) + .renewIfNecessary(); return (ret != null && ret > 0); } diff --git a/disjob-registry/disjob-registry-nacos/pom.xml b/disjob-registry/disjob-registry-nacos/pom.xml index 6d2dabf1d..c26835db6 100644 --- a/disjob-registry/disjob-registry-nacos/pom.xml +++ b/disjob-registry/disjob-registry-nacos/pom.xml @@ -25,7 +25,7 @@ com.alibaba.nacos nacos-client - 2.3.1 + 2.3.2 diff --git a/disjob-supervisor/src/test/java/cn/ponfee/disjob/supervisor/SpringBootTestCollector.java b/disjob-supervisor/src/test/java/cn/ponfee/disjob/supervisor/SpringBootTestCollector.java index d28445533..da4613071 100644 --- a/disjob-supervisor/src/test/java/cn/ponfee/disjob/supervisor/SpringBootTestCollector.java +++ b/disjob-supervisor/src/test/java/cn/ponfee/disjob/supervisor/SpringBootTestCollector.java @@ -50,7 +50,8 @@ public class SpringBootTestCollector { } public static void collect(ApplicationContext applicationContext, Class testClasses) { - TEST_CLASSES_MAP.computeIfAbsent(applicationContext, k -> ConcurrentHashMap.newKeySet()).add(testClasses); + TEST_CLASSES_MAP.computeIfAbsent(applicationContext, k -> ConcurrentHashMap.newKeySet()) + .add(testClasses); } } diff --git a/disjob-supervisor/src/test/resources/application.yml b/disjob-supervisor/src/test/resources/application.yml index aa6d06770..4eda342c4 100644 --- a/disjob-supervisor/src/test/resources/application.yml +++ b/disjob-supervisor/src/test/resources/application.yml @@ -1,4 +1,5 @@ -server.port: 0 +# -1: 单元测试时关闭HTTP端点;0: 自动寻找一个空闲的端口;${random.int[1,65535]}: 随机端口但可能会有端口冲突; +server.port: -1 # database configuration disjob.datasource: diff --git a/pom.xml b/pom.xml index 1dbc5806c..dea86c580 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 1.5.5.Final 33.1.0-jre 4.4 - 2.15.1 + 2.16.0 2.3.2 5.14.0 5.6.0 @@ -98,8 +98,8 @@ 2.8.2 1.6.0 - 0.8.8 - 3.2.1 + 0.8.11 + 3.2.2