From 01bebe36e81995ff38733a2e1b9dd432d2b60b3c Mon Sep 17 00:00:00 2001 From: yanghua Date: Fri, 3 Sep 2021 09:30:29 +0800 Subject: [PATCH] [KYUUBI #1011] Fallback some frontend service config option about thrift ### _Why are the changes needed?_ ### _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 #1016 from yanghua/KYUUBI-1011. Closes #1011 78107b76 [yanghua] Addressed review suggestion 651b5989 [yanghua] [KYUUBI #1011] Fallback some frontend service config option about thrift Authored-by: yanghua Signed-off-by: ulysses-you --- docs/deployment/settings.md | 24 ++++-- .../kyuubi/engine/spark/SparkSQLEngine.scala | 2 +- .../org/apache/kyuubi/config/KyuubiConf.scala | 83 ++++++++++++++++--- .../service/ThriftFrontendService.scala | 16 ++-- .../kyuubi/config/KyuubiConfSuite.scala | 14 ++-- .../kyuubi/service/ServerableSuite.scala | 6 +- .../service/ThriftFrontendServiceSuite.scala | 2 +- .../authentication/PlainSASLHelperSuite.scala | 2 +- .../kyuubi/session/SessionManagerSuite.scala | 2 +- .../kyuubi/ctl/ServiceControlCliSuite.scala | 12 +-- .../ha/client/ServiceDiscoverySuite.scala | 4 +- .../org/apache/kyuubi/WithKyuubiServer.scala | 2 +- .../apache/kyuubi/engine/EngineRefSuite.scala | 2 +- .../kyuubi/server/KyuubiServerSuite.scala | 4 +- 14 files changed, 123 insertions(+), 52 deletions(-) diff --git a/docs/deployment/settings.md b/docs/deployment/settings.md index be9a37f84..c5b488f49 100644 --- a/docs/deployment/settings.md +++ b/docs/deployment/settings.md @@ -183,14 +183,22 @@ kyuubi\.engine\.ui\.stop
\.enabled|
PT0.1S
|
Time to back off during login to the frontend service.
|
duration
|
1.0.0
-kyuubi\.frontend\.bind
\.host|
<undefined>
|
Hostname or IP of the machine on which to run the frontend service.
|
string
|
1.0.0
-kyuubi\.frontend\.bind
\.port|
10009
|
Port of the machine on which to run the frontend service.
|
int
|
1.0.0
-kyuubi\.frontend\.login
\.timeout|
PT20S
|
Timeout for Thrift clients during login to the frontend service.
|
duration
|
1.0.0
-kyuubi\.frontend\.max
\.message\.size|
104857600
|
Maximum message size in bytes a Kyuubi server will accept.
|
int
|
1.0.0
-kyuubi\.frontend\.max
\.worker\.threads|
999
|
Maximum number of threads in the of frontend worker thread pool for the frontend service
|
int
|
1.0.0
-kyuubi\.frontend\.min
\.worker\.threads|
9
|
Minimum number of threads in the of frontend worker thread pool for the frontend service
|
int
|
1.0.0
-kyuubi\.frontend
\.worker\.keepalive\.time|
PT1M
|
Keep-alive time (in milliseconds) for an idle worker thread
|
duration
|
1.0.0
+kyuubi\.frontend
\.backoff\.slot\.length|
PT0.1S
|
(deprecated) Time to back off during login to the thrift frontend service.
|
duration
|
1.0.0
+kyuubi\.frontend\.bind
\.host|
<undefined>
|
(deprecated) Hostname or IP of the machine on which to run the thrift frontend service via binary protocol.
|
string
|
1.0.0
+kyuubi\.frontend\.bind
\.port|
10009
|
(deprecated) Port of the machine on which to run the thrift frontend service via binary protocol.
|
int
|
1.0.0
+kyuubi\.frontend\.login
\.timeout|
PT20S
|
(deprecated) Timeout for Thrift clients during login to the thrift frontend service.
|
duration
|
1.0.0
+kyuubi\.frontend\.max
\.message\.size|
104857600
|
(deprecated) Maximum message size in bytes a Kyuubi server will accept.
|
int
|
1.0.0
+kyuubi\.frontend\.max
\.worker\.threads|
999
|
(deprecated) Maximum number of threads in the of frontend worker thread pool for the thrift frontend service
|
int
|
1.0.0
+kyuubi\.frontend\.min
\.worker\.threads|
9
|
(deprecated) Minimum number of threads in the of frontend worker thread pool for the thrift frontend service
|
int
|
1.0.0
+kyuubi\.frontend
\.thrift\.backoff\.slot
\.length|
PT0.1S
|
Time to back off during login to the thrift frontend service.
|
duration
|
1.4.0
+kyuubi\.frontend
\.thrift\.binary\.bind
\.host|
<undefined>
|
Hostname or IP of the machine on which to run the thrift frontend service via binary protocol.
|
string
|
1.4.0
+kyuubi\.frontend
\.thrift\.binary\.bind
\.port|
10009
|
Port of the machine on which to run the thrift frontend service via binary protocol.
|
int
|
1.4.0
+kyuubi\.frontend
\.thrift\.login\.timeout|
PT20S
|
Timeout for Thrift clients during login to the thrift frontend service.
|
duration
|
1.4.0
+kyuubi\.frontend
\.thrift\.max\.message
\.size|
104857600
|
Maximum message size in bytes a Kyuubi server will accept.
|
int
|
1.4.0
+kyuubi\.frontend
\.thrift\.max\.worker
\.threads|
999
|
Maximum number of threads in the of frontend worker thread pool for the thrift frontend service
|
int
|
1.4.0
+kyuubi\.frontend
\.thrift\.min\.worker
\.threads|
9
|
Minimum number of threads in the of frontend worker thread pool for the thrift frontend service
|
int
|
1.4.0
+kyuubi\.frontend
\.thrift\.worker
\.keepalive\.time|
PT1M
|
Keep-alive time (in milliseconds) for an idle worker thread
|
duration
|
1.4.0
+kyuubi\.frontend
\.worker\.keepalive\.time|
PT1M
|
(deprecated) Keep-alive time (in milliseconds) for an idle worker thread
|
duration
|
1.0.0
### Ha diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala index bed9f7bc9..6968e07ce 100644 --- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala +++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala @@ -105,7 +105,7 @@ object SparkSQLEngine extends Logging { val defaultCat = if (KyuubiSparkUtil.hiveClassesArePresent) "hive" else "in-memory" sparkConf.setIfMissing("spark.sql.catalogImplementation", defaultCat) - kyuubiConf.setIfMissing(KyuubiConf.FRONTEND_BIND_PORT, 0) + kyuubiConf.setIfMissing(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) kyuubiConf.setIfMissing(HA_ZK_CONN_RETRY_POLICY, RetryPolicies.N_TIME.toString) // Pass kyuubi config from spark with `spark.kyuubi` diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala index 48da7ea68..28611cd8f 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala @@ -132,6 +132,8 @@ case class KyuubiConf(loadSysDefault: Boolean = true) extends Logging { private val serverOnlyConfEntries: Set[ConfigEntry[_]] = Set( FRONTEND_BIND_HOST, FRONTEND_BIND_PORT, + FRONTEND_THRIFT_BINARY_BIND_HOST, + FRONTEND_THRIFT_BINARY_BIND_PORT, AUTHENTICATION_METHOD, SERVER_KEYTAB, SERVER_PRINCIPAL, @@ -235,61 +237,122 @@ object KyuubiConf { // Frontend Service Configuration // ///////////////////////////////////////////////////////////////////////////////////////////////// + @deprecated(s"using ${FRONTEND_THRIFT_BINARY_BIND_HOST.key} instead", "1.4.0") val FRONTEND_BIND_HOST: OptionalConfigEntry[String] = buildConf("frontend.bind.host") - .doc("Hostname or IP of the machine on which to run the frontend service.") + .doc("(deprecated) Hostname or IP of the machine on which to run the thrift frontend service " + + "via binary protocol.") .version("1.0.0") .stringConf .createOptional + val FRONTEND_THRIFT_BINARY_BIND_HOST: ConfigEntry[Option[String]] = + buildConf("frontend.thrift.binary.bind.host") + .doc("Hostname or IP of the machine on which to run the thrift frontend service " + + "via binary protocol.") + .version("1.4.0") + .fallbackConf(FRONTEND_BIND_HOST) + + @deprecated(s"using ${FRONTEND_THRIFT_BINARY_BIND_PORT.key} instead", "1.4.0") val FRONTEND_BIND_PORT: ConfigEntry[Int] = buildConf("frontend.bind.port") - .doc("Port of the machine on which to run the frontend service.") + .doc("(deprecated) Port of the machine on which to run the thrift frontend service " + + "via binary protocol.") .version("1.0.0") .intConf .checkValue(p => p == 0 || (p > 1024 && p < 65535), "Invalid Port number") .createWithDefault(10009) + val FRONTEND_THRIFT_BINARY_BIND_PORT: ConfigEntry[Int] = + buildConf("frontend.thrift.binary.bind.port") + .doc("Port of the machine on which to run the thrift frontend service via binary protocol.") + .version("1.4.0") + .fallbackConf(FRONTEND_BIND_PORT) + + @deprecated(s"using ${FRONTEND_THRIFT_MIN_WORKER_THREADS.key} instead", "1.4.0") val FRONTEND_MIN_WORKER_THREADS: ConfigEntry[Int] = buildConf("frontend.min.worker.threads") - .doc("Minimum number of threads in the of frontend worker thread pool for the frontend" + - " service") + .doc("(deprecated) Minimum number of threads in the of frontend worker thread pool for " + + "the thrift frontend service") .version("1.0.0") .intConf .createWithDefault(9) + val FRONTEND_THRIFT_MIN_WORKER_THREADS: ConfigEntry[Int] = + buildConf("frontend.thrift.min.worker.threads") + .doc("Minimum number of threads in the of frontend worker thread pool for the thrift " + + "frontend service") + .version("1.4.0") + .fallbackConf(FRONTEND_MIN_WORKER_THREADS) + + @deprecated(s"using ${FRONTEND_THRIFT_MAX_WORKER_THREADS.key} instead", "1.4.0") val FRONTEND_MAX_WORKER_THREADS: ConfigEntry[Int] = buildConf("frontend.max.worker.threads") - .doc("Maximum number of threads in the of frontend worker thread pool for the frontend" + - " service") + .doc("(deprecated) Maximum number of threads in the of frontend worker thread pool for " + + "the thrift frontend service") .version("1.0.0") .intConf .createWithDefault(999) + val FRONTEND_THRIFT_MAX_WORKER_THREADS: ConfigEntry[Int] = + buildConf("frontend.thrift.max.worker.threads") + .doc("Maximum number of threads in the of frontend worker thread pool for the thrift " + + "frontend service") + .version("1.4.0") + .fallbackConf(FRONTEND_MAX_WORKER_THREADS) + + @deprecated(s"using ${FRONTEND_THRIFT_WORKER_KEEPALIVE_TIME.key} instead", "1.4.0") val FRONTEND_WORKER_KEEPALIVE_TIME: ConfigEntry[Long] = buildConf("frontend.worker.keepalive.time") - .doc("Keep-alive time (in milliseconds) for an idle worker thread") + .doc("(deprecated) Keep-alive time (in milliseconds) for an idle worker thread") .version("1.0.0") .timeConf .createWithDefault(Duration.ofSeconds(60).toMillis) + val FRONTEND_THRIFT_WORKER_KEEPALIVE_TIME: ConfigEntry[Long] = + buildConf("frontend.thrift.worker.keepalive.time") + .doc("Keep-alive time (in milliseconds) for an idle worker thread") + .version("1.4.0") + .fallbackConf(FRONTEND_WORKER_KEEPALIVE_TIME) + + @deprecated(s"using ${FRONTEND_THRIFT_WORKER_KEEPALIVE_TIME.key} instead", "1.4.0") val FRONTEND_MAX_MESSAGE_SIZE: ConfigEntry[Int] = buildConf("frontend.max.message.size") - .doc("Maximum message size in bytes a Kyuubi server will accept.") + .doc("(deprecated) Maximum message size in bytes a Kyuubi server will accept.") .version("1.0.0") .intConf .createWithDefault(104857600) + val FRONTEND_THRIFT_MAX_MESSAGE_SIZE: ConfigEntry[Int] = + buildConf("frontend.thrift.max.message.size") + .doc("Maximum message size in bytes a Kyuubi server will accept.") + .version("1.4.0") + .fallbackConf(FRONTEND_MAX_MESSAGE_SIZE) + + @deprecated(s"using ${FRONTEND_THRIFT_LOGIN_TIMEOUT.key} instead", "1.4.0") val FRONTEND_LOGIN_TIMEOUT: ConfigEntry[Long] = buildConf("frontend.login.timeout") - .doc("Timeout for Thrift clients during login to the frontend service.") + .doc("(deprecated) Timeout for Thrift clients during login to the thrift frontend service.") .version("1.0.0") .timeConf .createWithDefault(Duration.ofSeconds(20).toMillis) + val FRONTEND_THRIFT_LOGIN_TIMEOUT: ConfigEntry[Long] = + buildConf("frontend.thrift.login.timeout") + .doc("Timeout for Thrift clients during login to the thrift frontend service.") + .version("1.4.0") + .fallbackConf(FRONTEND_LOGIN_TIMEOUT) + + @deprecated(s"using ${FRONTEND_THRIFT_LOGIN_BACKOFF_SLOT_LENGTH.key} instead", "1.4.0") val FRONTEND_LOGIN_BACKOFF_SLOT_LENGTH: ConfigEntry[Long] = buildConf("frontend.backoff.slot.length") - .doc("Time to back off during login to the frontend service.") + .doc("(deprecated) Time to back off during login to the thrift frontend service.") .version("1.0.0") .timeConf .createWithDefault(Duration.ofMillis(100).toMillis) + val FRONTEND_THRIFT_LOGIN_BACKOFF_SLOT_LENGTH: ConfigEntry[Long] = + buildConf("frontend.thrift.backoff.slot.length") + .doc("Time to back off during login to the thrift frontend service.") + .version("1.4.0") + .fallbackConf(FRONTEND_LOGIN_BACKOFF_SLOT_LENGTH) + val AUTHENTICATION_METHOD: ConfigEntry[String] = buildConf("authentication") .doc("Client authentication types.
    " + "
  • NOSASL: raw transport.
  • " + diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/ThriftFrontendService.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/ThriftFrontendService.scala index 0938aef0f..dbe2621df 100644 --- a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/ThriftFrontendService.scala +++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/ThriftFrontendService.scala @@ -60,12 +60,12 @@ class ThriftFrontendService private(name: String, be: BackendService, oomHook: R this.conf = conf try { hadoopConf = KyuubiHadoopUtils.newHadoopConf(conf) - val serverHost = conf.get(FRONTEND_BIND_HOST) + val serverHost = conf.get(FRONTEND_THRIFT_BINARY_BIND_HOST) serverAddr = serverHost.map(InetAddress.getByName).getOrElse(Utils.findLocalInetAddress) - portNum = conf.get(FRONTEND_BIND_PORT) - val minThreads = conf.get(FRONTEND_MIN_WORKER_THREADS) - val maxThreads = conf.get(FRONTEND_MAX_WORKER_THREADS) - val keepAliveTime = conf.get(FRONTEND_WORKER_KEEPALIVE_TIME) + portNum = conf.get(FRONTEND_THRIFT_BINARY_BIND_PORT) + val minThreads = conf.get(FRONTEND_THRIFT_MIN_WORKER_THREADS) + val maxThreads = conf.get(FRONTEND_THRIFT_MAX_WORKER_THREADS) + val keepAliveTime = conf.get(FRONTEND_THRIFT_WORKER_KEEPALIVE_TIME) val executor = ExecutorPoolCaptureOom( name + "Handler-Pool", minThreads, maxThreads, @@ -78,9 +78,9 @@ class ThriftFrontendService private(name: String, be: BackendService, oomHook: R portNum = serverSocket.getLocalPort val tServerSocket = new TServerSocket(serverSocket) - val maxMessageSize = conf.get(FRONTEND_MAX_MESSAGE_SIZE) - val requestTimeout = conf.get(FRONTEND_LOGIN_TIMEOUT).toInt - val beBackoffSlotLength = conf.get(FRONTEND_LOGIN_BACKOFF_SLOT_LENGTH).toInt + val maxMessageSize = conf.get(FRONTEND_THRIFT_MAX_MESSAGE_SIZE) + val requestTimeout = conf.get(FRONTEND_THRIFT_LOGIN_TIMEOUT).toInt + val beBackoffSlotLength = conf.get(FRONTEND_THRIFT_LOGIN_BACKOFF_SLOT_LENGTH).toInt val args = new TThreadPoolServer.Args(tServerSocket) .processorFactory(tProcFactory) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala index e49f2878a..9e859c827 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/config/KyuubiConfSuite.scala @@ -55,23 +55,23 @@ class KyuubiConfSuite extends KyuubiFunSuite { conf.set(OPERATION_IDLE_TIMEOUT, 5L) assert(conf.get(OPERATION_IDLE_TIMEOUT) === 5) - conf.set(FRONTEND_BIND_HOST, "kentyao.org") - assert(conf.get(FRONTEND_BIND_HOST).get === "kentyao.org") + conf.set(FRONTEND_THRIFT_BINARY_BIND_HOST.key, "kentyao.org") + assert(conf.get(FRONTEND_THRIFT_BINARY_BIND_HOST).get === "kentyao.org") conf.setIfMissing(OPERATION_IDLE_TIMEOUT, 60L) assert(conf.get(OPERATION_IDLE_TIMEOUT) === 5) - conf.setIfMissing(FRONTEND_MIN_WORKER_THREADS, 2188) - assert(conf.get(FRONTEND_MIN_WORKER_THREADS) === 2188) + conf.setIfMissing(FRONTEND_THRIFT_MIN_WORKER_THREADS, 2188) + assert(conf.get(FRONTEND_THRIFT_MIN_WORKER_THREADS) === 2188) - conf.unset(FRONTEND_MIN_WORKER_THREADS) - assert(conf.get(FRONTEND_MIN_WORKER_THREADS) === 9) + conf.unset(FRONTEND_THRIFT_MIN_WORKER_THREADS) + assert(conf.get(FRONTEND_THRIFT_MIN_WORKER_THREADS) === 9) conf.unset(key) assert(conf.getOption(key).isEmpty) val map = conf.getAllWithPrefix("kyuubi", "") - assert(map(FRONTEND_BIND_HOST.key.substring(7)) === "kentyao.org") + assert(map(FRONTEND_THRIFT_BINARY_BIND_HOST.key.substring(7)) === "kentyao.org") val map1 = conf.getAllWithPrefix("kyuubi", "operation") assert(map1(OPERATION_IDLE_TIMEOUT.key.substring(7)) === "PT0.005S") assert(map1.size === 1) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ServerableSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ServerableSuite.scala index d929278c6..8d6950f36 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ServerableSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ServerableSuite.scala @@ -24,7 +24,7 @@ class ServerableSuite extends KyuubiFunSuite { ignore("Serverable") { val serverable1 = new NoopServer() - val conf = KyuubiConf().set(KyuubiConf.FRONTEND_BIND_PORT, 0) + val conf = KyuubiConf().set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) serverable1.initialize(conf) assert(serverable1.getStartTime === 0) assert(serverable1.getConf === conf) @@ -43,7 +43,7 @@ class ServerableSuite extends KyuubiFunSuite { } test("invalid port") { - val conf = KyuubiConf().set(KyuubiConf.FRONTEND_BIND_PORT, 100) + val conf = KyuubiConf().set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 100) val e = intercept[KyuubiException](new NoopServer().initialize(conf)) assert(e.getMessage.contains("Failed to initialize frontend service")) assert(e.getCause.getMessage === "Invalid Port number") @@ -51,7 +51,7 @@ class ServerableSuite extends KyuubiFunSuite { test("error start child services") { val conf = KyuubiConf() - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) .set("kyuubi.test.server.should.fail", "true") val server = new NoopServer() server.initialize(conf) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ThriftFrontendServiceSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ThriftFrontendServiceSuite.scala index b0203b552..ca5d5b2b2 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ThriftFrontendServiceSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/ThriftFrontendServiceSuite.scala @@ -37,7 +37,7 @@ class ThriftFrontendServiceSuite extends KyuubiFunSuite { protected val server = new NoopServer() protected val conf = KyuubiConf() - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) .set("kyuubi.test.server.should.fail", "false") val user: String = System.getProperty("user.name") diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/PlainSASLHelperSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/PlainSASLHelperSuite.scala index b57b3165b..de0055b53 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/PlainSASLHelperSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/authentication/PlainSASLHelperSuite.scala @@ -30,7 +30,7 @@ class PlainSASLHelperSuite extends KyuubiFunSuite { test("PlainSASLHelper") { val server = new NoopServer() - val conf = KyuubiConf().set(KyuubiConf.FRONTEND_BIND_PORT, 0) + val conf = KyuubiConf().set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) server.initialize(conf) val service = server.getServices(0).asInstanceOf[ThriftFrontendService] val tProcessorFactory = PlainSASLHelper.getProcessFactory(service) diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/session/SessionManagerSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/session/SessionManagerSuite.scala index a79463a45..3e8c89301 100644 --- a/kyuubi-common/src/test/scala/org/apache/kyuubi/session/SessionManagerSuite.scala +++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/session/SessionManagerSuite.scala @@ -29,7 +29,7 @@ import org.apache.kyuubi.service.ThriftFrontendServiceSuite class SessionManagerSuite extends ThriftFrontendServiceSuite with Eventually { override val conf = KyuubiConf() - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) .set("kyuubi.test.server.should.fail", "false") .set(KyuubiConf.SESSION_CHECK_INTERVAL, Duration.ofSeconds(5).toMillis) .set(KyuubiConf.SESSION_IDLE_TIMEOUT, Duration.ofSeconds(5).toMillis) diff --git a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliSuite.scala b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliSuite.scala index 4ecdf4a41..9bd4d038b 100644 --- a/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliSuite.scala +++ b/kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliSuite.scala @@ -137,7 +137,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, namespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) val args = Array( "create", "server", @@ -184,7 +184,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, uniqueNamespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) System.setProperty(HA_ZK_NAMESPACE.key, uniqueNamespace) withZkClient(conf) { framework => @@ -242,7 +242,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, uniqueNamespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) withZkClient(conf) { framework => createServiceNode(conf, framework, uniqueNamespace, "localhost:10000") @@ -270,7 +270,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, uniqueNamespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) withZkClient(conf) { framework => createServiceNode(conf, framework, uniqueNamespace, "localhost:10000") @@ -299,7 +299,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, uniqueNamespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) withZkClient(conf) { framework => withZkClient(conf) { zc => @@ -330,7 +330,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, uniqueNamespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) withZkClient(conf) { framework => createServiceNode(conf, framework, uniqueNamespace, "localhost:10000") diff --git a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala index 2217e80a5..8ab4b40e2 100644 --- a/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala +++ b/kyuubi-ha/src/test/scala/org/apache/kyuubi/ha/client/ServiceDiscoverySuite.scala @@ -63,7 +63,7 @@ class ServiceDiscoverySuite extends KerberizedTestHelper { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, namespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) val server: Serverable = new NoopServer() server.initialize(conf) @@ -146,7 +146,7 @@ class ServiceDiscoverySuite extends KerberizedTestHelper { .unset(KyuubiConf.SERVER_PRINCIPAL) .set(HA_ZK_QUORUM, zkServer.getConnectString) .set(HA_ZK_NAMESPACE, namespace) - .set(KyuubiConf.FRONTEND_BIND_PORT, 0) + .set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) .set(HA_ZK_ACL_ENABLED, false) val server: Serverable = new NoopServer() diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/WithKyuubiServer.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/WithKyuubiServer.scala index c3808762c..2901dd22f 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/WithKyuubiServer.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/WithKyuubiServer.scala @@ -40,7 +40,7 @@ trait WithKyuubiServer extends KyuubiFunSuite { conf.set("spark.ui.enabled", "false") conf.setIfMissing("spark.sql.catalogImplementation", "in-memory") - conf.set(FRONTEND_BIND_PORT, 0) + conf.set(FRONTEND_THRIFT_BINARY_BIND_PORT, 0) conf.setIfMissing(ENGINE_CHECK_INTERVAL, 3000L) conf.setIfMissing(ENGINE_IDLE_TIMEOUT, 10000L) conf.set(HA_ZK_QUORUM, zkServer.getConnectString) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/EngineRefSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/EngineRefSuite.scala index 066d49639..71cd73d06 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/EngineRefSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/EngineRefSuite.scala @@ -133,7 +133,7 @@ class EngineRefSuite extends KyuubiFunSuite { test("start and get engine address with lock") { val id = SessionHandle(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10) conf.set(KyuubiConf.ENGINE_SHARE_LEVEL, USER.toString) - conf.set(KyuubiConf.FRONTEND_BIND_PORT, 0) + conf.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) conf.set(HighAvailabilityConf.HA_ZK_NAMESPACE, "engine_test") conf.set(HighAvailabilityConf.HA_ZK_QUORUM, zkServer.getConnectString) val engine = EngineRef(conf, user, id) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala index d44b8f248..3c247520f 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/KyuubiServerSuite.scala @@ -26,7 +26,7 @@ class KyuubiServerSuite extends KyuubiFunSuite { test("kyuubi server basic") { val server = new KyuubiServer() server.stop() - val conf = KyuubiConf().set(KyuubiConf.FRONTEND_BIND_PORT, 0) + val conf = KyuubiConf().set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0) assert(server.getServices.isEmpty) assert(server.getServiceState === LATENT) val e = intercept[IllegalStateException](server.connectionUrl) @@ -60,7 +60,7 @@ class KyuubiServerSuite extends KyuubiFunSuite { } test("invalid port") { - val conf = KyuubiConf().set(KyuubiConf.FRONTEND_BIND_PORT, 100) + val conf = KyuubiConf().set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 100) val e = intercept[KyuubiException](new KyuubiServer().initialize(conf)) assert(e.getMessage.contains("Failed to initialize frontend service")) assert(e.getCause.getMessage === "Invalid Port number")