Skip to content

Commit

Permalink
Rename HA_ZK_ENGINE_REF_ID to HA_ENGINE_REF_ID
Browse files Browse the repository at this point in the history
  • Loading branch information
hddong committed Jul 12, 2022
1 parent aa2b426 commit 9e81a6a
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ object HighAvailabilityConf {
.checkValue(_ > 0, "Must be positive")
.createWithDefault(Duration.ofSeconds(120).toMillis)

val HA_ZK_ENGINE_REF_ID: OptionalConfigEntry[String] =
val HA_ENGINE_REF_ID: OptionalConfigEntry[String] =
buildConf("kyuubi.ha.engine.ref.id")
.doc("The engine reference id will be attached to zookeeper node when engine started, " +
"and the kyuubi server will check it cyclically.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import org.apache.kyuubi.KyuubiSQLException
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.config.KyuubiConf.ENGINE_INIT_TIMEOUT
import org.apache.kyuubi.ha.HighAvailabilityConf
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ZK_ENGINE_REF_ID
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ENGINE_REF_ID
import org.apache.kyuubi.ha.client.DiscoveryClient
import org.apache.kyuubi.ha.client.DiscoveryPaths
import org.apache.kyuubi.ha.client.ServiceDiscovery
Expand Down Expand Up @@ -268,7 +268,7 @@ class EtcdDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
val ns = DiscoveryPaths.makePath(null, namespace)
create(ns, "PERSISTENT")

val session = conf.get(HA_ZK_ENGINE_REF_ID)
val session = conf.get(HA_ENGINE_REF_ID)
.map(refId => s"refId=$refId;").getOrElse("")
val pathPrefix = DiscoveryPaths.makePath(
namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class ZookeeperACLProvider(conf: KyuubiConf) extends ACLProvider {
nodeAcls.addAll(ZooDefs.Ids.CREATOR_ALL_ACL)
}

if (conf.get(HighAvailabilityConf.HA_ZK_ENGINE_REF_ID).isEmpty && enabledServerAcls()) {
if (conf.get(HighAvailabilityConf.HA_ENGINE_REF_ID).isEmpty && enabledServerAcls()) {
addACL()
} else if (conf.get(HighAvailabilityConf.HA_ZK_ENGINE_REF_ID).nonEmpty && enabledEngineAcls()) {
} else if (conf.get(HighAvailabilityConf.HA_ENGINE_REF_ID).nonEmpty && enabledEngineAcls()) {
addACL()
} else {
// ACLs for znodes on a non-kerberized cluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ object ZookeeperClientProvider extends Logging {
}
}

if (conf.get(HA_ZK_ENGINE_REF_ID).isEmpty
if (conf.get(HA_ENGINE_REF_ID).isEmpty
&& AuthTypes.withName(conf.get(HA_ZK_AUTH_TYPE)) == AuthTypes.KERBEROS) {
setupZkAuth()
} else if (conf.get(HA_ZK_ENGINE_REF_ID).nonEmpty && AuthTypes
} else if (conf.get(HA_ENGINE_REF_ID).nonEmpty && AuthTypes
.withName(conf.get(HA_ZK_ENGINE_AUTH_TYPE)) == AuthTypes.KERBEROS) {
setupZkAuth()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import org.apache.kyuubi.KyuubiException
import org.apache.kyuubi.KyuubiSQLException
import org.apache.kyuubi.Logging
import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ZK_ENGINE_REF_ID
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ENGINE_REF_ID
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ZK_NODE_TIMEOUT
import org.apache.kyuubi.ha.HighAvailabilityConf.HA_ZK_PUBLISH_CONFIGS
import org.apache.kyuubi.ha.client.DiscoveryClient
Expand Down Expand Up @@ -344,7 +344,7 @@ class ZookeeperDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
throw new KyuubiException(s"Failed to create namespace '$ns'", e)
}

val session = conf.get(HA_ZK_ENGINE_REF_ID)
val session = conf.get(HA_ENGINE_REF_ID)
.map(refId => s"refId=$refId;").getOrElse("")
val pathPrefix = ZKPaths.makePath(
namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ class ZookeeperDiscoveryClientSuite extends DiscoveryClientTests with Kerberized
val serverACL = new ZookeeperACLProvider(serverConf).getDefaultAcl
assertACL(expectedEnableACL, serverACL)

val engineConf = serverConf.clone.set(HA_ZK_ENGINE_REF_ID, "ref")
val engineConf = serverConf.clone.set(HA_ENGINE_REF_ID, "ref")
engineConf.set(HA_ZK_ENGINE_AUTH_TYPE, AuthTypes.NONE.toString)
val engineACL = new ZookeeperACLProvider(engineConf).getDefaultAcl
assertACL(expectedNoACL, engineACL)

val enableEngineACLConf = serverConf.clone.set(HA_ZK_ENGINE_REF_ID, "ref")
val enableEngineACLConf = serverConf.clone.set(HA_ENGINE_REF_ID, "ref")
enableEngineACLConf.set(HA_ZK_ENGINE_AUTH_TYPE, AuthTypes.KERBEROS.toString)
val enableEngineACL = new ZookeeperACLProvider(enableEngineACLConf).getDefaultAcl
assertACL(expectedEnableACL, enableEngineACL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.apache.kyuubi.engine.flink.FlinkProcessBuilder
import org.apache.kyuubi.engine.hive.HiveProcessBuilder
import org.apache.kyuubi.engine.spark.SparkProcessBuilder
import org.apache.kyuubi.engine.trino.TrinoProcessBuilder
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_NAMESPACE, HA_ZK_ENGINE_REF_ID}
import org.apache.kyuubi.ha.HighAvailabilityConf.{HA_ENGINE_REF_ID, HA_NAMESPACE}
import org.apache.kyuubi.ha.client.{DiscoveryClient, DiscoveryPaths}
import org.apache.kyuubi.metrics.MetricsConstants.{ENGINE_FAIL, ENGINE_TIMEOUT, ENGINE_TOTAL}
import org.apache.kyuubi.metrics.MetricsSystem
Expand Down Expand Up @@ -167,7 +167,7 @@ private[kyuubi] class EngineRef(
if (engineRef.nonEmpty) return engineRef.get

conf.set(HA_NAMESPACE, engineSpace)
conf.set(HA_ZK_ENGINE_REF_ID, engineRefId)
conf.set(HA_ENGINE_REF_ID, engineRefId)
val started = System.currentTimeMillis()
conf.set(KYUUBI_ENGINE_SUBMIT_TIME_KEY, String.valueOf(started))
builder = engineType match {
Expand Down

0 comments on commit 9e81a6a

Please sign in to comment.