[KYUUBI #1797] Only exposing jdbc url for server side

<!--
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.
-->

Only exposing the jdbc url in server side, it is not needed to expose it in engine side and also not secure.

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

- [ ] Add screenshots for manual tests if appropriate

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

Closes #1797 from turboFei/hide_url.

Closes #1797

f696b141 [Fei Wang] Only exposing jdbc url for server

Authored-by: Fei Wang <fwang12@ebay.com>
Signed-off-by: ulysses-you <ulyssesyou@apache.org>
This commit is contained in:
Fei Wang 2022-01-19 16:28:32 +08:00 committed by ulysses-you
parent 78dfef84db
commit c65df0fa36
No known key found for this signature in database
GPG Key ID: 4C500BC62D576766
2 changed files with 7 additions and 1 deletions

View File

@ -100,7 +100,9 @@ abstract class TBinaryFrontendService(name: String)
override def run(): Unit =
try {
info(s"Starting and exposing JDBC connection at: jdbc:hive2://$connectionUrl/")
if (isServer()) {
info(s"Starting and exposing JDBC connection at: jdbc:hive2://$connectionUrl/")
}
server.foreach(_.serve())
} catch {
case _: InterruptedException => error(s"$getName is interrupted")
@ -113,4 +115,6 @@ abstract class TBinaryFrontendService(name: String)
server.foreach(_.stop())
server = None
}
protected def isServer(): Boolean = false
}

View File

@ -72,4 +72,6 @@ final class KyuubiTBinaryFrontendService(
override protected def oomHook: Runnable = {
() => serverable.stop()
}
override protected def isServer(): Boolean = true
}