Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: queue support root.xxx #659

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ object EngineConnPluginConfiguration {
val EC_BML_VERSION_MAY_WITH_PREFIX_V: CommonVars[Boolean] =
CommonVars("linkis.engineconn.bml.version.may.with.prefix", true)

val QUEUE_PREFIX: CommonVars[String] =
CommonVars("wds.linkis.queue.prefix", "root.")

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.linkis.manager.rm.external.yarn

import org.apache.linkis.common.utils.{Logging, Utils}
import org.apache.linkis.engineplugin.server.conf.EngineConnPluginConfiguration
import org.apache.linkis.manager.common.conf.RMConfiguration
import org.apache.linkis.manager.common.entity.resource.{
CommonNodeResource,
Expand Down Expand Up @@ -57,6 +58,8 @@ class YarnResourceRequester extends ExternalResourceRequester with Logging {

private val HASTATE_ACTIVE = "active"

private val queuePrefix = EngineConnPluginConfiguration.QUEUE_PREFIX.getValue

private val rmAddressMap: util.Map[String, String] = new ConcurrentHashMap[String, String]()

private def getAuthorizationStr(provider: ExternalResourceProvider) = {
Expand All @@ -72,7 +75,11 @@ class YarnResourceRequester extends ExternalResourceRequester with Logging {
): NodeResource = {
val rmWebAddress = getAndUpdateActiveRmWebAddress(provider)
logger.info(s"rmWebAddress: $rmWebAddress")
val queueName = identifier.asInstanceOf[YarnResourceIdentifier].getQueueName
var queueName = identifier.asInstanceOf[YarnResourceIdentifier].getQueueName
if (queueName.startsWith(queuePrefix)) {
logger.info(s"Queue name [$queueName] starts with '[$queuePrefix]', remove '[$queuePrefix]]'")
queueName = queueName.substring(queuePrefix.length)
}

def getYarnResource(jValue: Option[JValue]) = jValue.map(r =>
new YarnResource(
Expand Down Expand Up @@ -110,7 +117,7 @@ class YarnResourceRequester extends ExternalResourceRequester with Logging {
})
}

var realQueueName = "root." + queueName
var realQueueName = queuePrefix + queueName

def getQueue(queues: JValue): Option[JValue] = queues match {
case JArray(queue) =>
Expand Down Expand Up @@ -280,7 +287,7 @@ class YarnResourceRequester extends ExternalResourceRequester with Logging {
)
)

val realQueueName = "root." + queueName
val realQueueName = queuePrefix + queueName

def getAppInfos(): Array[ExternalAppInfo] = {
val resp = getResponseByUrl("apps", rmWebAddress, provider)
Expand Down
Loading