Skip to content

Commit

Permalink
Engine space with kyuubi version
Browse files Browse the repository at this point in the history
  • Loading branch information
cxzl25 committed Mar 27, 2022
1 parent a5b4c1b commit 78b8336
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import scala.collection.mutable.ListBuffer
import org.apache.curator.framework.CuratorFramework
import org.apache.curator.utils.ZKPaths

import org.apache.kyuubi.Logging
import org.apache.kyuubi.{KYUUBI_VERSION, Logging}
import org.apache.kyuubi.config.KyuubiConf.ENGINE_SHARE_LEVEL_SUBDOMAIN
import org.apache.kyuubi.config.KyuubiConf.ENGINE_TYPE
import org.apache.kyuubi.engine.ShareLevel
Expand Down Expand Up @@ -235,8 +235,10 @@ object ServiceControlCli extends CommandLineUtils with Logging {
val engineSubdomain = Some(args.cliArgs.engineSubdomain)
.filter(_ != null).filter(_.nonEmpty)
.getOrElse(args.conf.get(ENGINE_SHARE_LEVEL_SUBDOMAIN).getOrElse("default"))
// The path of the engine defined in zookeeper comes from
// org.apache.kyuubi.engine.EngineRef#engineSpace
ZKPaths.makePath(
s"${args.cliArgs.namespace}_${ShareLevel.USER}_${engineType}",
s"${args.cliArgs.namespace}_${KYUUBI_VERSION}_${ShareLevel.USER}_${engineType}",
args.cliArgs.user,
engineSubdomain)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
"--user",
user)
assert(getZkNamespace(new ServiceControlCliArguments(arg2)) ==
s"/${namespace}_USER_SPARK_SQL/$user/default")
s"/${namespace}_${KYUUBI_VERSION}_USER_SPARK_SQL/$user/default")
}

test("test list zk service nodes info") {
Expand Down Expand Up @@ -417,7 +417,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
"--user",
user)
assert(getZkNamespace(new ServiceControlCliArguments(arg1)) ==
s"/${namespace}_USER_SPARK_SQL/$user/default")
s"/${namespace}_${KYUUBI_VERSION}_USER_SPARK_SQL/$user/default")

val arg2 = Array(
"list",
Expand All @@ -431,7 +431,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
"--engine-type",
"FLINK_SQL")
assert(getZkNamespace(new ServiceControlCliArguments(arg2)) ==
s"/${namespace}_USER_FLINK_SQL/$user/default")
s"/${namespace}_${KYUUBI_VERSION}_USER_FLINK_SQL/$user/default")

val arg3 = Array(
"list",
Expand All @@ -445,7 +445,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
"--engine-type",
"TRINO")
assert(getZkNamespace(new ServiceControlCliArguments(arg3)) ==
s"/${namespace}_USER_TRINO/$user/default")
s"/${namespace}_${KYUUBI_VERSION}_USER_TRINO/$user/default")

val arg4 = Array(
"list",
Expand All @@ -461,6 +461,6 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
"--engine-subdomain",
"sub_1")
assert(getZkNamespace(new ServiceControlCliArguments(arg4)) ==
s"/${namespace}_USER_SPARK_SQL/$user/sub_1")
s"/${namespace}_${KYUUBI_VERSION}_USER_SPARK_SQL/$user/sub_1")
}
}

0 comments on commit 78b8336

Please sign in to comment.