Skip to content

Commit 3b81a49

Browse files
committed
[KYUUBI #2631] Rename high availability config key to support multi discovery client
### _Why are the changes needed?_ Rename high availability config key to support muti discovery client ### _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.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2633 from hddong/muti-discovery-config-support. Closes #2631 bc434ac [hongdongdong] [KYUUBI #2631] Rename high availability config key to support muti discovery client Authored-by: hongdongdong <hongdongdong@cmss.chinamobile.com> Signed-off-by: hongdongdong <hongdongdong@cmss.chinamobile.com>
1 parent 7a789a2 commit 3b81a49

File tree

17 files changed

+88
-175
lines changed

17 files changed

+88
-175
lines changed

docs/deployment/settings.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,9 @@ Key | Default | Meaning | Type | Since
273273

274274
Key | Default | Meaning | Type | Since
275275
--- | --- | --- | --- | ---
276-
<code>kyuubi.ha.service.discovery.client.class</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>org.apache.kyuubi.ha.client.zookeeper.ZookeeperDiscoveryClient</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Class name for service discovery client.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.6.0</div>
276+
<code>kyuubi.ha.addresses</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The connection string for the discovery ensemble</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.6.0</div>
277+
<code>kyuubi.ha.client.class</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>org.apache.kyuubi.ha.client.zookeeper.ZookeeperDiscoveryClient</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Class name for service discovery client.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.6.0</div>
278+
<code>kyuubi.ha.namespace</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>kyuubi</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The root directory for the service to deploy its instance uri</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.6.0</div>
277279
<code>kyuubi.ha.zookeeper.acl.enabled</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>false</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Set to true if the zookeeper ensemble is kerberized</div>|<div style='width: 30pt'>boolean</div>|<div style='width: 20pt'>1.0.0</div>
278280
<code>kyuubi.ha.zookeeper.auth.digest</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>&lt;undefined&gt;</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The digest auth string is used for zookeeper authentication, like: username:password.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.3.2</div>
279281
<code>kyuubi.ha.zookeeper.auth.keytab</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>&lt;undefined&gt;</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Location of Kyuubi server's keytab is used for zookeeper authentication.</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.3.2</div>
@@ -285,10 +287,10 @@ Key | Default | Meaning | Type | Since
285287
<code>kyuubi.ha.zookeeper.connection.retry.policy</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>EXPONENTIAL_BACKOFF</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The retry policy for connecting to the zookeeper ensemble, all candidates are: <ul><li>ONE_TIME</li><li> N_TIME</li><li> EXPONENTIAL_BACKOFF</li><li> BOUNDED_EXPONENTIAL_BACKOFF</li><li> UNTIL_ELAPSED</li></ul></div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
286288
<code>kyuubi.ha.zookeeper.connection.timeout</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>15000</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The timeout(ms) of creating the connection to the zookeeper ensemble</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
287289
<code>kyuubi.ha.zookeeper.engine.auth.type</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>NONE</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The type of zookeeper authentication for engine, all candidates are <ul><li>NONE</li><li> KERBEROS</li><li> DIGEST</li></ul></div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.3.2</div>
288-
<code>kyuubi.ha.zookeeper.namespace</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>kyuubi</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The root directory for the service to deploy its instance uri</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
290+
<code>kyuubi.ha.zookeeper.namespace</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>kyuubi</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) The root directory for the service to deploy its instance uri</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
289291
<code>kyuubi.ha.zookeeper.node.creation.timeout</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>PT2M</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>Timeout for creating zookeeper node</div>|<div style='width: 30pt'>duration</div>|<div style='width: 20pt'>1.2.0</div>
290292
<code>kyuubi.ha.zookeeper.publish.configs</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>false</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>When set to true, publish Kerberos configs to Zookeeper.Note that the Hive driver needs to be greater than 1.3 or 2.0 or apply HIVE-11581 patch.</div>|<div style='width: 30pt'>boolean</div>|<div style='width: 20pt'>1.4.0</div>
291-
<code>kyuubi.ha.zookeeper.quorum</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The connection string for the zookeeper ensemble</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
293+
<code>kyuubi.ha.zookeeper.quorum</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'></div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>(deprecated) The connection string for the zookeeper ensemble</div>|<div style='width: 30pt'>string</div>|<div style='width: 20pt'>1.0.0</div>
292294
<code>kyuubi.ha.zookeeper.session.timeout</code>|<div style='width: 65pt;word-wrap: break-word;white-space: normal'>60000</div>|<div style='width: 170pt;word-wrap: break-word;white-space: normal'>The timeout(ms) of a connected session to be idled</div>|<div style='width: 30pt'>int</div>|<div style='width: 20pt'>1.0.0</div>
293295

294296

externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/WithDiscoverySparkSQLEngine.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package org.apache.kyuubi.engine.spark
1919

2020
import org.apache.kyuubi.Utils
2121
import org.apache.kyuubi.config.KyuubiConf
22-
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_ZK_AUTH_TYPE, HA_ZK_NAMESPACE, HA_ZK_QUORUM}
22+
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_ADDRESSES, HA_NAMESPACE, HA_ZK_AUTH_TYPE}
2323
import org.apache.kyuubi.ha.client.AuthTypes
2424
import org.apache.kyuubi.ha.client.DiscoveryClient
2525
import org.apache.kyuubi.ha.client.DiscoveryClientProvider
@@ -31,9 +31,9 @@ trait WithDiscoverySparkSQLEngine extends WithSparkSQLEngine {
3131
override def withKyuubiConf: Map[String, String] = {
3232
assert(zkServer != null)
3333
Map(
34-
HA_ZK_QUORUM.key -> zkServer.getConnectString,
34+
HA_ADDRESSES.key -> zkServer.getConnectString,
3535
HA_ZK_AUTH_TYPE.key -> AuthTypes.NONE.toString,
36-
HA_ZK_NAMESPACE.key -> namespace)
36+
HA_NAMESPACE.key -> namespace)
3737
}
3838

3939
override def beforeAll(): Unit = {

kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/ServiceControlCli.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ private[kyuubi] class ServiceControlCli extends Logging {
7979
private def create(args: ServiceControlCliArguments): Unit = {
8080
val kyuubiConf = args.conf
8181

82-
kyuubiConf.setIfMissing(HA_ZK_QUORUM, args.cliArgs.zkQuorum)
82+
kyuubiConf.setIfMissing(HA_ADDRESSES, args.cliArgs.zkQuorum)
8383
withDiscoveryClient(kyuubiConf) { discoveryClient =>
84-
val fromNamespace = DiscoveryPaths.makePath(null, kyuubiConf.get(HA_ZK_NAMESPACE))
84+
val fromNamespace =
85+
DiscoveryPaths.makePath(null, kyuubiConf.get(HA_NAMESPACE))
8586
val toNamespace = getZkNamespace(args)
8687

8788
val currentServerNodes = discoveryClient.getServiceNodesInfo(fromNamespace)
@@ -104,10 +105,10 @@ private[kyuubi] class ServiceControlCli extends Logging {
104105
}
105106
}
106107

107-
if (kyuubiConf.get(HA_ZK_QUORUM) == args.cliArgs.zkQuorum) {
108+
if (kyuubiConf.get(HA_ADDRESSES) == args.cliArgs.zkQuorum) {
108109
doCreate(discoveryClient)
109110
} else {
110-
kyuubiConf.set(HA_ZK_QUORUM, args.cliArgs.zkQuorum)
111+
kyuubiConf.set(HA_ADDRESSES, args.cliArgs.zkQuorum)
111112
withDiscoveryClient(kyuubiConf)(doCreate)
112113
}
113114
}

kyuubi-ctl/src/main/scala/org/apache/kyuubi/ctl/ServiceControlCliArguments.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class ServiceControlCliArguments(args: Seq[String], env: Map[String, String] = s
164164
private def useDefaultPropertyValueIfMissing(value: CliArguments): CliArguments = {
165165
var arguments: CliArguments = value.copy()
166166
if (value.zkQuorum == null) {
167-
conf.getOption(HA_ZK_QUORUM.key).foreach { v =>
167+
conf.getOption(HA_ADDRESSES.key).foreach { v =>
168168
if (arguments.verbose) {
169169
super.info(s"Zookeeper quorum is not specified, use value from default conf:$v")
170170
}
@@ -173,7 +173,7 @@ class ServiceControlCliArguments(args: Seq[String], env: Map[String, String] = s
173173
}
174174

175175
if (arguments.namespace == null) {
176-
arguments = arguments.copy(namespace = conf.get(HA_ZK_NAMESPACE))
176+
arguments = arguments.copy(namespace = conf.get(HA_NAMESPACE))
177177
if (arguments.verbose) {
178178
super.info(s"Zookeeper namespace is not specified, use value from default conf:" +
179179
s"${arguments.namespace}")
@@ -206,8 +206,8 @@ class ServiceControlCliArguments(args: Seq[String], env: Map[String, String] = s
206206
}
207207
validateZkArguments()
208208

209-
val defaultNamespace = conf.getOption(HA_ZK_NAMESPACE.key)
210-
.getOrElse(HA_ZK_NAMESPACE.defaultValStr)
209+
val defaultNamespace = conf.getOption(HA_NAMESPACE.key)
210+
.getOrElse(HA_NAMESPACE.defaultValStr)
211211
if (defaultNamespace.equals(cliArgs.namespace)) {
212212
fail(
213213
s"""
@@ -234,8 +234,8 @@ class ServiceControlCliArguments(args: Seq[String], env: Map[String, String] = s
234234
}
235235

236236
private def mergeArgsIntoKyuubiConf(): Unit = {
237-
conf.set(HA_ZK_QUORUM.key, cliArgs.zkQuorum)
238-
conf.set(HA_ZK_NAMESPACE.key, cliArgs.namespace)
237+
conf.set(HA_ADDRESSES.key, cliArgs.zkQuorum)
238+
conf.set(HA_NAMESPACE.key, cliArgs.namespace)
239239
}
240240

241241
private def validateZkArguments(): Unit = {

kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliArgumentsSuite.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package org.apache.kyuubi.ctl
1919

2020
import org.apache.kyuubi.{KYUUBI_VERSION, KyuubiFunSuite}
21-
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ZK_NAMESPACE
21+
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_NAMESPACE
2222

2323
class ServiceControlCliArgumentsSuite extends KyuubiFunSuite {
2424
val zkQuorum = "localhost:2181"
@@ -102,7 +102,7 @@ class ServiceControlCliArgumentsSuite extends KyuubiFunSuite {
102102
}
103103
}
104104

105-
withSystemProperty(HA_ZK_NAMESPACE.key, namespace) {
105+
withSystemProperty(HA_NAMESPACE.key, namespace) {
106106
val op = "create"
107107
val service = "server"
108108
val newNamespace = s"${namespace}_new"
@@ -267,7 +267,7 @@ class ServiceControlCliArgumentsSuite extends KyuubiFunSuite {
267267
}
268268

269269
test("test create action arguments") {
270-
withSystemProperty(HA_ZK_NAMESPACE.key, namespace) {
270+
withSystemProperty(HA_NAMESPACE.key, namespace) {
271271
val newNamespace = s"${namespace}_new"
272272
val op = "create"
273273
val args = Array(

kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/ServiceControlCliSuite.scala

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import scala.collection.mutable.ArrayBuffer
2424

2525
import org.apache.kyuubi.{KYUUBI_VERSION, KyuubiFunSuite}
2626
import org.apache.kyuubi.config.KyuubiConf
27-
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_ZK_NAMESPACE, HA_ZK_QUORUM}
27+
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_ADDRESSES, HA_NAMESPACE}
2828
import org.apache.kyuubi.ha.client.{DiscoveryClientProvider, ServiceNodeInfo}
2929
import org.apache.kyuubi.zookeeper.{EmbeddedZookeeper, ZookeeperConf}
3030

@@ -90,7 +90,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
9090

9191
val zkServer = new EmbeddedZookeeper()
9292
val conf: KyuubiConf = KyuubiConf()
93-
var envZkNamespaceProperty: String = System.getProperty(HA_ZK_NAMESPACE.key)
93+
var envZkNamespaceProperty: String = System.getProperty(HA_NAMESPACE.key)
9494
val namespace = "kyuubiserver"
9595
val host = "localhost"
9696
val port = "10000"
@@ -99,18 +99,18 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
9999
val counter = new AtomicInteger(0)
100100

101101
override def beforeAll(): Unit = {
102-
setSystemProperty(HA_ZK_NAMESPACE.key, namespace)
102+
setSystemProperty(HA_NAMESPACE.key, namespace)
103103
conf.set(ZookeeperConf.ZK_CLIENT_PORT, 0)
104104
zkServer.initialize(conf)
105105
zkServer.start()
106106
super.beforeAll()
107107
}
108108

109109
override def afterAll(): Unit = {
110-
setSystemProperty(HA_ZK_NAMESPACE.key, envZkNamespaceProperty)
110+
setSystemProperty(HA_NAMESPACE.key, envZkNamespaceProperty)
111111
conf.unset(KyuubiConf.SERVER_KEYTAB)
112112
conf.unset(KyuubiConf.SERVER_PRINCIPAL)
113-
conf.unset(HA_ZK_QUORUM)
113+
conf.unset(HA_ADDRESSES)
114114
zkServer.stop()
115115
super.afterAll()
116116
}
@@ -135,8 +135,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
135135
conf
136136
.unset(KyuubiConf.SERVER_KEYTAB)
137137
.unset(KyuubiConf.SERVER_PRINCIPAL)
138-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
139-
.set(HA_ZK_NAMESPACE, namespace)
138+
.set(HA_ADDRESSES, zkServer.getConnectString)
139+
.set(HA_NAMESPACE, namespace)
140140
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
141141

142142
val args = Array(
@@ -157,7 +157,7 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
157157
conf
158158
.unset(KyuubiConf.SERVER_KEYTAB)
159159
.unset(KyuubiConf.SERVER_PRINCIPAL)
160-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
160+
.set(HA_ADDRESSES, zkServer.getConnectString)
161161
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
162162

163163
val args2 = Array(
@@ -176,8 +176,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
176176
conf
177177
.unset(KyuubiConf.SERVER_KEYTAB)
178178
.unset(KyuubiConf.SERVER_PRINCIPAL)
179-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
180-
.set(HA_ZK_NAMESPACE, namespace)
179+
.set(HA_ADDRESSES, zkServer.getConnectString)
180+
.set(HA_NAMESPACE, namespace)
181181
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
182182

183183
val args = Array(
@@ -219,10 +219,10 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
219219
conf
220220
.unset(KyuubiConf.SERVER_KEYTAB)
221221
.unset(KyuubiConf.SERVER_PRINCIPAL)
222-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
223-
.set(HA_ZK_NAMESPACE, uniqueNamespace)
222+
.set(HA_ADDRESSES, zkServer.getConnectString)
223+
.set(HA_NAMESPACE, uniqueNamespace)
224224
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
225-
System.setProperty(HA_ZK_NAMESPACE.key, uniqueNamespace)
225+
System.setProperty(HA_NAMESPACE.key, uniqueNamespace)
226226

227227
withDiscoveryClient(conf) { framework =>
228228
framework.createAndGetServiceNode(conf, uniqueNamespace, "localhost:10000")
@@ -284,8 +284,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
284284
conf
285285
.unset(KyuubiConf.SERVER_KEYTAB)
286286
.unset(KyuubiConf.SERVER_PRINCIPAL)
287-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
288-
.set(HA_ZK_NAMESPACE, uniqueNamespace)
287+
.set(HA_ADDRESSES, zkServer.getConnectString)
288+
.set(HA_NAMESPACE, uniqueNamespace)
289289
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
290290

291291
withDiscoveryClient(conf) { framework =>
@@ -313,8 +313,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
313313
conf
314314
.unset(KyuubiConf.SERVER_KEYTAB)
315315
.unset(KyuubiConf.SERVER_PRINCIPAL)
316-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
317-
.set(HA_ZK_NAMESPACE, uniqueNamespace)
316+
.set(HA_ADDRESSES, zkServer.getConnectString)
317+
.set(HA_NAMESPACE, uniqueNamespace)
318318
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
319319

320320
withDiscoveryClient(conf) { framework =>
@@ -345,8 +345,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
345345
conf
346346
.unset(KyuubiConf.SERVER_KEYTAB)
347347
.unset(KyuubiConf.SERVER_PRINCIPAL)
348-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
349-
.set(HA_ZK_NAMESPACE, uniqueNamespace)
348+
.set(HA_ADDRESSES, zkServer.getConnectString)
349+
.set(HA_NAMESPACE, uniqueNamespace)
350350
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
351351

352352
withDiscoveryClient(conf) { framework =>
@@ -379,8 +379,8 @@ class ServiceControlCliSuite extends KyuubiFunSuite with TestPrematureExit {
379379
conf
380380
.unset(KyuubiConf.SERVER_KEYTAB)
381381
.unset(KyuubiConf.SERVER_PRINCIPAL)
382-
.set(HA_ZK_QUORUM, zkServer.getConnectString)
383-
.set(HA_ZK_NAMESPACE, uniqueNamespace)
382+
.set(HA_ADDRESSES, zkServer.getConnectString)
383+
.set(HA_NAMESPACE, uniqueNamespace)
384384
.set(KyuubiConf.FRONTEND_THRIFT_BINARY_BIND_PORT, 0)
385385

386386
withDiscoveryClient(conf) { framework =>

kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/HighAvailabilityConf.scala

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,39 @@ object HighAvailabilityConf {
2929

3030
private def buildConf(key: String): ConfigBuilder = KyuubiConf.buildConf(key)
3131

32+
@deprecated(s"using ${HA_ADDRESSES.key} instead", "1.6.0")
3233
val HA_ZK_QUORUM: ConfigEntry[String] = buildConf("kyuubi.ha.zookeeper.quorum")
33-
.doc("The connection string for the zookeeper ensemble")
34+
.doc("(deprecated) The connection string for the zookeeper ensemble")
3435
.version("1.0.0")
3536
.stringConf
3637
.createWithDefault("")
3738

39+
@deprecated(s"using ${HA_NAMESPACE.key} instead", "1.6.0")
3840
val HA_ZK_NAMESPACE: ConfigEntry[String] = buildConf("kyuubi.ha.zookeeper.namespace")
39-
.doc("The root directory for the service to deploy its instance uri")
41+
.doc("(deprecated) The root directory for the service to deploy its instance uri")
4042
.version("1.0.0")
4143
.stringConf
4244
.createWithDefault("kyuubi")
4345

46+
val HA_ADDRESSES: ConfigEntry[String] = buildConf("kyuubi.ha.addresses")
47+
.doc("The connection string for the discovery ensemble")
48+
.version("1.6.0")
49+
.fallbackConf(HA_ZK_QUORUM)
50+
51+
val HA_NAMESPACE: ConfigEntry[String] =
52+
buildConf("kyuubi.ha.namespace")
53+
.doc("The root directory for the service to deploy its instance uri")
54+
.version("1.6.0")
55+
.fallbackConf(HA_ZK_NAMESPACE)
56+
57+
val HA_CLIENT_CLASS: ConfigEntry[String] =
58+
buildConf("kyuubi.ha.client.class")
59+
.doc("Class name for service discovery client.")
60+
.version("1.6.0")
61+
.stringConf
62+
.checkValue(_.nonEmpty, "must not be empty")
63+
.createWithDefault("org.apache.kyuubi.ha.client.zookeeper.ZookeeperDiscoveryClient")
64+
4465
@deprecated(s"using ${HA_ZK_AUTH_TYPE.key} and ${HA_ZK_ENGINE_AUTH_TYPE.key} instead", "1.3.2")
4566
val HA_ZK_ACL_ENABLED: ConfigEntry[Boolean] =
4667
buildConf("kyuubi.ha.zookeeper.acl.enabled")
@@ -159,12 +180,4 @@ object HighAvailabilityConf {
159180
.version("1.5.0")
160181
.stringConf
161182
.createOptional
162-
163-
val HA_DISCOVERY_CLIENT_CLASS: ConfigEntry[String] =
164-
buildConf("kyuubi.ha.service.discovery.client.class")
165-
.doc("Class name for service discovery client.")
166-
.version("1.6.0")
167-
.stringConf
168-
.checkValue(_.nonEmpty, "must not be empty")
169-
.createWithDefault("org.apache.kyuubi.ha.client.zookeeper.ZookeeperDiscoveryClient")
170183
}

kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/DiscoveryClientProvider.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ object DiscoveryClientProvider extends Logging {
4545

4646
def createDiscoveryClient(conf: KyuubiConf): DiscoveryClient = {
4747
val classLoader = Thread.currentThread.getContextClassLoader
48-
val className = conf.get(HighAvailabilityConf.HA_DISCOVERY_CLIENT_CLASS)
48+
val className = conf.get(HighAvailabilityConf.HA_CLIENT_CLASS)
4949
if (className.isEmpty) {
5050
throw new KyuubiException(
51-
s"${HighAvailabilityConf.HA_DISCOVERY_CLIENT_CLASS.key} cannot be empty.")
51+
s"${HighAvailabilityConf.HA_CLIENT_CLASS.key} cannot be empty.")
5252
}
5353
val cls = Class.forName(className, true, classLoader)
5454
cls match {

0 commit comments

Comments
 (0)