From c65df0fa36b19315d319b2b4d3ab5fcb0626bd67 Mon Sep 17 00:00:00 2001 From: Fei Wang Date: Wed, 19 Jan 2022 16:28:32 +0800 Subject: [PATCH] [KYUUBI #1797] Only exposing jdbc url for server side ### _Why are the changes needed?_ 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 Signed-off-by: ulysses-you --- .../org/apache/kyuubi/service/TBinaryFrontendService.scala | 6 +++++- .../apache/kyuubi/server/KyuubiTBinaryFrontendService.scala | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TBinaryFrontendService.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TBinaryFrontendService.scala index fbd376806..c23d4dc27 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TBinaryFrontendService.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TBinaryFrontendService.scala @@ -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 } diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiTBinaryFrontendService.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiTBinaryFrontendService.scala index e17a5319d..701003cda 100644 --- a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiTBinaryFrontendService.scala +++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiTBinaryFrontendService.scala @@ -72,4 +72,6 @@ final class KyuubiTBinaryFrontendService( override protected def oomHook: Runnable = { () => serverable.stop() } + + override protected def isServer(): Boolean = true }