From ed4827d56011c997281370af6f02d2bdd3bad7d5 Mon Sep 17 00:00:00 2001 From: czs Date: Mon, 11 Mar 2024 17:08:30 +0800 Subject: [PATCH 1/2] NULL may be used when optimizing heartbeat detection of cluster instances --- dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java b/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java index b0a99e3bbf..505b92ca8c 100644 --- a/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java +++ b/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java @@ -33,6 +33,9 @@ public interface DinkyAssert { static void check(ClusterInstance clusterInstance) { + if (clusterInstance == null) { + throw new BusException("Flink集群不存在"); + } if (clusterInstance.getId() == null) { throw new BusException("Flink 集群【" + clusterInstance.getId() + "】不存在"); } From e0781fd1f93f35d8d44fb972fe6ea170d669ac97 Mon Sep 17 00:00:00 2001 From: czs Date: Mon, 11 Mar 2024 17:16:32 +0800 Subject: [PATCH 2/2] use i18n msg --- dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java b/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java index 505b92ca8c..e6c106c775 100644 --- a/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java +++ b/dinky-admin/src/main/java/org/dinky/assertion/DinkyAssert.java @@ -34,7 +34,7 @@ public interface DinkyAssert { static void check(ClusterInstance clusterInstance) { if (clusterInstance == null) { - throw new BusException("Flink集群不存在"); + throw new BusException(Status.CLUSTER_NOT_EXIST); } if (clusterInstance.getId() == null) { throw new BusException("Flink 集群【" + clusterInstance.getId() + "】不存在");