From 2766ca122853ea661c17bff261c628c9671021f7 Mon Sep 17 00:00:00 2001 From: ClownXC Date: Mon, 1 Apr 2024 12:22:28 +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 79f29575a14..e692b404210 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 (!seaTunnelServer.isMasterNode() && shouldBeMaster) { + if (shouldBeMaster && !seaTunnelServer.isMasterNode()) { return null; } return seaTunnelServer; @@ -373,8 +373,12 @@ private JsonObject convertToJson(JobInfo jobInfo, long jobId) { .getNodeEngine() .getSerializationService() .toObject(jobInfo.getJobImmutableInformation())); + SeaTunnelServer seaTunnelServer = getSeaTunnelServer(true); - ClassLoaderService classLoaderService = getSeaTunnelServer(false).getClassLoaderService(); + 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) {