diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java index 817a3ee3b2abe3c..4405da6ce13dd91 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterWorkloadGroupStmt.java @@ -28,7 +28,7 @@ import org.apache.doris.resource.workloadgroup.WorkloadGroup; import org.apache.doris.resource.workloadgroup.WorkloadGroupMgr; -import com.aliyuncs.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.Map; diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java index cefcdc0ccbcc54b..dd13542a8361f3e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/CreateWorkloadGroupStmt.java @@ -29,7 +29,7 @@ import org.apache.doris.resource.workloadgroup.WorkloadGroup; import org.apache.doris.resource.workloadgroup.WorkloadGroupMgr; -import com.aliyuncs.utils.StringUtils; +import org.apache.commons.lang3.StringUtils; import java.util.Map; diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java b/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java index 1c24ca69d4f1917..214fbe0e41089f4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/FeConstants.java @@ -50,6 +50,9 @@ public class FeConstants { // set to false to disable internal schema db public static boolean enableInternalSchemaDb = true; + // for UT, create internal workload group thread can not start + public static boolean shouldCreateInternalWorkloadGroup = true; + // default scheduler interval is 10 seconds public static int default_scheduler_interval_millisecond = 10000; diff --git a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/CreateInternalWorkloadGroupThread.java b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/CreateInternalWorkloadGroupThread.java index 2c94b6ad1e269e1..7c6d0e3a0808188 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/CreateInternalWorkloadGroupThread.java +++ b/fe/fe-core/src/main/java/org/apache/doris/resource/workloadgroup/CreateInternalWorkloadGroupThread.java @@ -18,6 +18,7 @@ package org.apache.doris.resource.workloadgroup; import org.apache.doris.catalog.Env; +import org.apache.doris.common.FeConstants; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -31,6 +32,9 @@ public CreateInternalWorkloadGroupThread() { } public void run() { + if (!FeConstants.shouldCreateInternalWorkloadGroup) { + return; + } try { Env env = Env.getCurrentEnv(); while (!env.isReady()) { diff --git a/fe/fe-core/src/test/java/org/apache/doris/utframe/TestWithFeService.java b/fe/fe-core/src/test/java/org/apache/doris/utframe/TestWithFeService.java index 8e25efdfada4393..70adbbd7f99f5ec 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/utframe/TestWithFeService.java +++ b/fe/fe-core/src/test/java/org/apache/doris/utframe/TestWithFeService.java @@ -153,6 +153,7 @@ public Set getEnableNereidsRules() { @BeforeAll public final void beforeAll() throws Exception { FeConstants.enableInternalSchemaDb = false; + FeConstants.shouldCreateInternalWorkloadGroup = false; beforeCreatingConnectContext(); connectContext = createDefaultCtx(); beforeCluster();