From 01e34363328ef8c0a5dd6d0679be898160463e99 Mon Sep 17 00:00:00 2001 From: ClownXC Date: Mon, 1 Apr 2024 09:09:34 +0800 Subject: [PATCH] code style --- .../engine/server/rest/RestHttpGetCommandProcessor.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java index 106a041e60a..2c30d728efd 100644 --- a/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java +++ b/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java @@ -353,7 +353,7 @@ private SeaTunnelServer getSeaTunnelServer(boolean shouldBeMaster) { this.textCommandService.getNode().getNodeExtension().createExtensionServices(); SeaTunnelServer seaTunnelServer = (SeaTunnelServer) extensionServices.get(Constant.SEATUNNEL_SERVICE_NAME); - if (shouldBeMaster && !seaTunnelServer.isMasterNode()) { + if (!seaTunnelServer.isMasterNode() && shouldBeMaster) { return null; } return seaTunnelServer; @@ -374,7 +374,11 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) { .getSerializationService() .toObject(jobInfo.getJobImmutableInformation())); - ClassLoaderService classLoaderService = getSeaTunnelServer(false).getClassLoaderService(); + SeaTunnelServer seaTunnelServer = getSeaTunnelServer(true); + ClassLoaderService classLoaderService = + seaTunnelServer == null + ? getSeaTunnelServer(false).getClassLoaderService() + : seaTunnelServer.getClassLoaderService(); ClassLoader classLoader = classLoaderService.getClassLoader( jobId, jobImmutableInformation.getPluginJarsUrls()); @@ -385,7 +389,6 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) { jobImmutableInformation.getLogicalDag()); classLoaderService.releaseClassLoader(jobId, jobImmutableInformation.getPluginJarsUrls()); - SeaTunnelServer seaTunnelServer = getSeaTunnelServer(true); String jobMetrics; JobStatus jobStatus; if (seaTunnelServer == null) {