[KYUUBI #1011] Fallback some frontend service config option about thrift
<!-- 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. --> ### _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 <yanghua1127@gmail.com> Signed-off-by: ulysses-you <ulyssesyou18@gmail.com>
This commit is contained in:
parent
7b289ae6ff
commit
01bebe36e8
@ -183,14 +183,22 @@ kyuubi\.engine\.ui\.stop<br>\.enabled|<div style='width: 65pt;word-wrap: break-w
|
||||
|
||||
Key | Default | Meaning | Type | Since
|
||||
--- | --- | --- | --- | ---
|
||||
kyuubi\.frontend<br>\.backoff\.slot\.length|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT0.1S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Time to back off during login to the frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.bind<br>\.host|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Hostname or IP of the machine on which to run the frontend service.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.bind<br>\.port|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>10009</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Port of the machine on which to run the frontend service.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.login<br>\.timeout|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT20S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Timeout for Thrift clients during login to the frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.max<br>\.message\.size|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>104857600</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Maximum message size in bytes a Kyuubi server will accept.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.max<br>\.worker\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>999</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Maximum number of threads in the of frontend worker thread pool for the frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.min<br>\.worker\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>9</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Minimum number of threads in the of frontend worker thread pool for the frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend<br>\.worker\.keepalive\.time|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT1M</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Keep-alive time (in milliseconds) for an idle worker thread</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend<br>\.backoff\.slot\.length|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT0.1S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Time to back off during login to the thrift frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.bind<br>\.host|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Hostname or IP of the machine on which to run the thrift frontend service via binary protocol.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.bind<br>\.port|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>10009</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Port of the machine on which to run the thrift frontend service via binary protocol.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.login<br>\.timeout|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT20S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Timeout for Thrift clients during login to the thrift frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.max<br>\.message\.size|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>104857600</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Maximum message size in bytes a Kyuubi server will accept.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.max<br>\.worker\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>999</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Maximum number of threads in the of frontend worker thread pool for the thrift frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend\.min<br>\.worker\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>9</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Minimum number of threads in the of frontend worker thread pool for the thrift frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.backoff\.slot<br>\.length|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT0.1S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Time to back off during login to the thrift frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.binary\.bind<br>\.host|<div style='width: 65pt;word-wrap: break-word;white-space: normal'><undefined></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Hostname or IP of the machine on which to run the thrift frontend service via binary protocol.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.binary\.bind<br>\.port|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>10009</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Port of the machine on which to run the thrift frontend service via binary protocol.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.login\.timeout|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT20S</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Timeout for Thrift clients during login to the thrift frontend service.</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.max\.message<br>\.size|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>104857600</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Maximum message size in bytes a Kyuubi server will accept.</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.max\.worker<br>\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>999</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Maximum number of threads in the of frontend worker thread pool for the thrift frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.min\.worker<br>\.threads|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>9</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Minimum number of threads in the of frontend worker thread pool for the thrift frontend service</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.thrift\.worker<br>\.keepalive\.time|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT1M</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Keep-alive time (in milliseconds) for an idle worker thread</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.4.0</div>
|
||||
kyuubi\.frontend<br>\.worker\.keepalive\.time|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT1M</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) Keep-alive time (in milliseconds) for an idle worker thread</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.0.0</div>
|
||||
|
||||
|
||||
### Ha
|
||||
|
||||
@ -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`
|
||||
|
||||
@ -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.<ul>" +
|
||||
" <li>NOSASL: raw transport.</li>" +
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user