Skip to content

Commit

Permalink
[KYUUBI #1775] Add kyuubi.server.name configuration
Browse files Browse the repository at this point in the history
<!--
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>
  • Loading branch information
wForget authored and ulysses-you committed Jan 18, 2022
1 parent 3aba64d commit 916f81a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions docs/deployment/settings.md
Expand Up @@ -293,6 +293,13 @@ kyuubi\.operation<br>\.status\.polling\.max<br>\.attempts|<div style='width: 65p
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>


### Server

Key | Default | Meaning | Type | Since
--- | --- | --- | --- | ---
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>


### Session

Key | Default | Meaning | Type | Since
Expand Down
Expand Up @@ -1109,4 +1109,11 @@ object KyuubiConf {
.transform(_.toUpperCase(Locale.ROOT))
.checkValues(OperationLanguages.values.map(_.toString))
.createWithDefault(OperationLanguages.SQL.toString)

val SERVER_NAME: OptionalConfigEntry[String] =
buildConf("server.name")
.doc("The name of Kyuubi Server.")
.version("1.5.0")
.stringConf
.createOptional
}
Expand Up @@ -89,7 +89,10 @@ object KyuubiServer extends Logging {
}
}

val server = new KyuubiServer()
val server = conf.get(KyuubiConf.SERVER_NAME) match {
case Some(s) => new KyuubiServer(s)
case _ => new KyuubiServer()
}
try {
server.initialize(conf)
} catch {
Expand Down

0 comments on commit 916f81a

Please sign in to comment.