Skip to content

Commit c65df0f

Browse files
turboFeiulysses-you
authored andcommitted
[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 f696b14 [Fei Wang] Only exposing jdbc url for server Authored-by: Fei Wang <fwang12@ebay.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
1 parent 78dfef8 commit c65df0f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

kyuubi-common/src/main/scala/org/apache/kyuubi/service/TBinaryFrontendService.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ abstract class TBinaryFrontendService(name: String)
100100

101101
override def run(): Unit =
102102
try {
103-
info(s"Starting and exposing JDBC connection at: jdbc:hive2://$connectionUrl/")
103+
if (isServer()) {
104+
info(s"Starting and exposing JDBC connection at: jdbc:hive2://$connectionUrl/")
105+
}
104106
server.foreach(_.serve())
105107
} catch {
106108
case _: InterruptedException => error(s"$getName is interrupted")
@@ -113,4 +115,6 @@ abstract class TBinaryFrontendService(name: String)
113115
server.foreach(_.stop())
114116
server = None
115117
}
118+
119+
protected def isServer(): Boolean = false
116120
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,6 @@ final class KyuubiTBinaryFrontendService(
7272
override protected def oomHook: Runnable = {
7373
() => serverable.stop()
7474
}
75+
76+
override protected def isServer(): Boolean = true
7577
}

0 commit comments

Comments
 (0)