You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/05/09 07:07:31 UTC
[GitHub] [incubator-kyuubi] hiboyang commented on a diff in pull request #2601: Add a config to support different service discovery client class implementation
hiboyang commented on code in PR #2601:
URL: https://github.com/apache/incubator-kyuubi/pull/2601#discussion_r867696750
##########
kyuubi-ha/src/main/scala/org/apache/kyuubi/ha/client/DiscoveryClientProvider.scala:
##########
@@ -42,4 +41,15 @@ object DiscoveryClientProvider extends Logging {
}
}
+ def createDiscoveryClient(conf: KyuubiConf): DiscoveryClient = {
+ val className = conf.get(KyuubiConf.DISCOVERY_CLIENT_CLASS)
+ val clazz =
+ try {
+ Class.forName(className)
+ } catch {
+ case ex: Throwable => throw new KyuubiException(s"Class not found $className", ex)
+ }
+ val constructor = clazz.getConstructor(conf.getClass)
+ constructor.newInstance(conf).asInstanceOf[DiscoveryClient]
Review Comment:
Thanks for the suggestion! Updated the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org