diff --git a/linkis-commons/linkis-scheduler/src/main/java/org/apache/linkis/scheduler/util/SchedulerUtils.java b/linkis-commons/linkis-scheduler/src/main/java/org/apache/linkis/scheduler/util/SchedulerUtils.java index af12ef6e24..62191aa20e 100644 --- a/linkis-commons/linkis-scheduler/src/main/java/org/apache/linkis/scheduler/util/SchedulerUtils.java +++ b/linkis-commons/linkis-scheduler/src/main/java/org/apache/linkis/scheduler/util/SchedulerUtils.java @@ -21,8 +21,6 @@ import org.apache.commons.lang3.StringUtils; -import java.util.Locale; - public class SchedulerUtils { private static final String EVENT_ID_SPLIT = "_"; private static final String ALL_CREATORS = "ALL_CREATORS"; @@ -50,7 +48,7 @@ public static boolean isSupportPriority(String groupName) { return users.contains(userName.toLowerCase()); } else { String creatorName = getCreatorFromGroupName(groupName); - return users.contains(userName) && creators.contains(creatorName.toLowerCase()); + return users.contains(userName.toLowerCase()) && creators.contains(creatorName.toLowerCase()); } } diff --git a/linkis-commons/linkis-scheduler/src/test/scala/org/apache/linkis/scheduler/util/TestSchedulerUtils.scala b/linkis-commons/linkis-scheduler/src/test/scala/org/apache/linkis/scheduler/util/TestSchedulerUtils.scala index 6443c645ef..ba281e4798 100644 --- a/linkis-commons/linkis-scheduler/src/test/scala/org/apache/linkis/scheduler/util/TestSchedulerUtils.scala +++ b/linkis-commons/linkis-scheduler/src/test/scala/org/apache/linkis/scheduler/util/TestSchedulerUtils.scala @@ -20,13 +20,22 @@ package org.apache.linkis.scheduler.util import org.apache.linkis.scheduler.util.SchedulerUtils.{ getCreatorFromGroupName, getEngineTypeFromGroupName, - getUserFromGroupName + getUserFromGroupName, + isSupportPriority } import org.junit.jupiter.api.{Assertions, Test} class TestSchedulerUtils { + @Test + def testIsSupportPriority: Unit = { + // set linkis.fifo.queue.support.priority.users=hadoop + // set linkis.fifo.queue.support.priority.creators=IDE or ALL_CREATORS + val bool: Boolean = isSupportPriority("IdE_haDoop_hive") + Assertions.assertEquals(true, bool) + } + @Test def testShellDangerCode: Unit = { var groupName = "IDE_hadoop_hive"