Skip to content

Commit

Permalink
fix(ha): ADH-5001. Added support for service discovery for THRIFT_HTT…
Browse files Browse the repository at this point in the history
…P mode.
  • Loading branch information
Asmoday committed Jan 23, 2025
1 parent e9f01c6 commit 22fc5a1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.eclipse.jetty.util.thread.ExecutorThreadPool
import org.apache.kyuubi.KyuubiException
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.config.KyuubiConf._
import org.apache.kyuubi.ha.client.{KyuubiServiceDiscovery, ServiceDiscovery}
import org.apache.kyuubi.metrics.MetricsConstants.{THRIFT_HTTP_CONN_FAIL, THRIFT_HTTP_CONN_OPEN, THRIFT_HTTP_CONN_TOTAL}
import org.apache.kyuubi.metrics.MetricsSystem
import org.apache.kyuubi.server.http.ThriftHttpServlet
Expand Down Expand Up @@ -237,7 +238,13 @@ final class KyuubiTHttpFrontendService(

override protected def isServer(): Boolean = true

override val discoveryService: Option[Service] = None
override lazy val discoveryService: Option[Service] = {
if (ServiceDiscovery.supportServiceDiscovery(conf)) {
Some(new KyuubiServiceDiscovery(this))
} else {
None
}
}

private def getHttpPath(httpPath: String): String = {
if (httpPath == null || httpPath == "") return "/*"
Expand Down

0 comments on commit 22fc5a1

Please sign in to comment.