From 262cac01a69dfab704ad3f4d490e429f517f28a3 Mon Sep 17 00:00:00 2001 From: Calvin Kirs Date: Wed, 14 Feb 2024 23:44:23 +0800 Subject: [PATCH] [Improve](Job)Return directly when the job status does not need to change --- .../main/java/org/apache/doris/job/base/AbstractJob.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/job/base/AbstractJob.java b/fe/fe-core/src/main/java/org/apache/doris/job/base/AbstractJob.java index 091ac158c1ce83..78d7598bf135a5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/job/base/AbstractJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/job/base/AbstractJob.java @@ -244,11 +244,11 @@ public void updateJobStatus(JobStatus newJobStatus) throws JobException { if (null == newJobStatus) { throw new IllegalArgumentException("jobStatus cannot be null"); } - String errorMsg = String.format("Can't update job %s status to the %s status", - jobStatus.name(), newJobStatus.name()); if (jobStatus == newJobStatus) { - throw new IllegalArgumentException(errorMsg); + return; } + String errorMsg = String.format("Can't update job %s status to the %s status", + jobStatus.name(), newJobStatus.name()); if (newJobStatus.equals(JobStatus.RUNNING) && !jobStatus.equals(JobStatus.PAUSED)) { throw new IllegalArgumentException(errorMsg); }