Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KYUUBI #2008][FOLLOWUP] Support engine type and subdomain in kyuubi-ctl #2233

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
}