kyuubi/docs
yanyu34946 93e9745a39
[KYUUBI #1293] Fix potential failure of engine discovery when mixed use subdomain
### _Why are the changes needed?_

Fix #1293

This PR is a rework of #1303, also related to #962

We have two options to fix this issue. This PR implements option 2.

```
[option 1]
kyuubi.engine.share.level.subdomain: String -- default: "default"
kyuubi.engine.pool.size: Int                -- default: -1

val subdomain =
    if (kyuubi.engine.share.level.subdomain == "default" && kyuubi.engine.pool.size > 0) {
        s"engine-pool-[num]"
    } else {
        kyuubi.engine.share.level.subdomain
    }

[option 2]
kyuubi.engine.share.level.subdomain: Option[String] -- default: None
kyuubi.engine.pool.size: Int                        -- default: -1

val subdomain =
    kyuubi.engine.share.level.subdomain match {
        case Some(value) => value
        case None if kyuubi.engine.pool.size > 0 => s"engine-pool-[num]"
        case None => "default"
    }
```
```
[diff]
[[case1]]
kyuubi.engine.share.level.subdomain=default
kyuubi.engine.pool.size=2

option 1 result: subdomain="engine-pool-[num]"
option 2 result: subdomain="default"

[[case2]]
kyuubi.engine.share.level.subdomain=hello
kyuubi.engine.pool.size=2

option 1 result: subdomain="hello"
option 2 result: subdomain="hello"

[[case3]]
kyuubi.engine.share.level.subdomain=
kyuubi.engine.pool.size=2

option 1 result: subdomain="engine-pool-[num]"
option 2 result: subdomain="engine-pool-[num]"

[[case4]]
kyuubi.engine.share.level.subdomain=
kyuubi.engine.pool.size=

option 1 result: subdomain="default"
option 2 result: subdomain="default"

[[case5]]
kyuubi.engine.share.level.subdomain="hello"
kyuubi.engine.pool.size=

option 1 result: subdomain="hello"
option 2 result: subdomain="hello"
```

### _How was this patch tested?_
- [x] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #1402 from pan3793/1293.

Closes #1293

f6c4a7db [Cheng Pan] nit
fd427bfb [yanyu34946] [KYUUBI #1293] Fix bootstrap potential failure when mixed use subdomain

Lead-authored-by: yanyu34946 <875082356@qq.com>
Co-authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2021-11-18 18:00:30 +08:00
..
appendix [KYUUBI #1347] [DOC] Fix miscellaneous doc typos 2021-11-08 09:27:37 +08:00
client [KYUUBI #1347] [DOC] Fix miscellaneous doc typos 2021-11-08 09:27:37 +08:00
community [KYUUBI #1347] [DOC] Fix miscellaneous doc typos 2021-11-08 09:27:37 +08:00
deployment [KYUUBI #1293] Fix potential failure of engine discovery when mixed use subdomain 2021-11-18 18:00:30 +08:00
develop_tools [KYUUBI #1347] [DOC] Fix miscellaneous doc typos 2021-11-08 09:27:37 +08:00
imgs [KYUUBI #1399] [DOCS] Add doc for engine share level 2021-11-16 19:58:25 +08:00
integrations [KYUUBI #951] [LICENSE] Add license header on all docs 2021-08-19 09:53:52 +08:00
monitor [KYUUBI #1347] [DOC] Fix miscellaneous doc typos 2021-11-08 09:27:37 +08:00
overview [KYUUBI #1399] [DOCS] Add doc for engine share level 2021-11-16 19:58:25 +08:00
quick_start [KYUUBI #1335] Spell issue branch 2021-11-05 09:33:32 +08:00
security [KYUUBI #1090] Add deployment document about Hadoop Credentials Manager 2021-09-15 10:02:09 +08:00
sql [KYUUBI #1335] Spell issue branch 2021-11-05 09:33:32 +08:00
tools [KYUUBI #1335] Spell issue branch 2021-11-05 09:33:32 +08:00
conf.py [KYUUBI #874] [ASF] ASF Publish 2021-08-16 11:48:21 +08:00
index.rst [KYUUBI #951] [LICENSE] Add license header on all docs 2021-08-19 09:53:52 +08:00
make.bat [KYUUBI #874] [ASF] ASF Publish 2021-08-16 11:48:21 +08:00
Makefile [KYUUBI #874] [ASF] ASF Publish 2021-08-16 11:48:21 +08:00
requirements.txt [KYUUBI #874] [ASF] ASF Publish 2021-08-16 11:48:21 +08:00