Skip to content

Commit 916f81a

Browse files
wForgetulysses-you
authored andcommitted
[KYUUBI #1775] Add kyuubi.server.name configuration
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> Add `kyuubi.server.name` configuration. #1775 ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [X] Add screenshots for manual tests if appropriate ![image](https://user-images.githubusercontent.com/17894939/149863381-0f71c33a-f2b2-48ef-a53f-1f48ce35fc7f.png) ![image](https://user-images.githubusercontent.com/17894939/149863308-677e54cd-d766-47e5-a284-7b2a475da82d.png) - [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1789 from wForget/KYUUBI-1775. Closes #1775 8b89504 [Wang Zhen] [KYUUBI-1775] Add kyuubi.server.name configuration Authored-by: Wang Zhen <wangzhen07@qiyi.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
1 parent 3aba64d commit 916f81a

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

docs/deployment/settings.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@ kyuubi\.operation<br>\.status\.polling\.max<br>\.attempts|<div style='width: 65p
293293
kyuubi\.operation<br>\.status\.polling<br>\.timeout|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT5S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Timeout(ms) for long polling asynchronous running sql query's status</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
294294

295295

296+
### Server
297+
298+
Key | Default | Meaning | Type | Since
299+
--- | --- | --- | --- | ---
300+
kyuubi\.server\.name|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>&lt;undefined&gt;</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The name of Kyuubi Server.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.5.0</div>
301+
302+
296303
### Session
297304

298305
Key | Default | Meaning | Type | Since

kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,4 +1109,11 @@ object KyuubiConf {
11091109
.transform(_.toUpperCase(Locale.ROOT))
11101110
.checkValues(OperationLanguages.values.map(_.toString))
11111111
.createWithDefault(OperationLanguages.SQL.toString)
1112+
1113+
val SERVER_NAME: OptionalConfigEntry[String] =
1114+
buildConf("server.name")
1115+
.doc("The name of Kyuubi Server.")
1116+
.version("1.5.0")
1117+
.stringConf
1118+
.createOptional
11121119
}

kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiServer.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ object KyuubiServer extends Logging {
8989
}
9090
}
9191

92-
val server = new KyuubiServer()
92+
val server = conf.get(KyuubiConf.SERVER_NAME) match {
93+
case Some(s) => new KyuubiServer(s)
94+
case _ => new KyuubiServer()
95+
}
9396
try {
9497
server.initialize(conf)
9598
} catch {

0 commit comments

Comments
 (0)