Skip to content

Commit

Permalink
feat: root.xxx适配 (#678)
Browse files Browse the repository at this point in the history
* feat: kill reason && queue support root.xxx

* Revert "feat: kill reason && queue support root.xxx"

This reverts commit 50113f5.

* feat: queue support root.xxx

* feat: queue support root.xxx

* feat: queue support root.xxx

* fix: deal conflicts
  • Loading branch information
taoran1250 authored Dec 13, 2024
1 parent f6da992 commit 84df21e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.linkis.manager.rm.external.yarn;

import org.apache.linkis.engineplugin.server.conf.EngineConnPluginConfiguration;
import org.apache.linkis.manager.common.entity.resource.CommonNodeResource;
import org.apache.linkis.manager.common.entity.resource.NodeResource;
import org.apache.linkis.manager.common.entity.resource.ResourceType;
Expand Down Expand Up @@ -57,6 +58,7 @@ public class YarnResourceRequester implements ExternalResourceRequester {
private final String HASTATE_ACTIVE = "active";
private static final ObjectMapper objectMapper = new ObjectMapper();
private final Map<String, String> rmAddressMap = new ConcurrentHashMap<>();
private final String queuePrefix = EngineConnPluginConfiguration.QUEUE_PREFIX().getValue();

private static final HttpClient httpClient = HttpClients.createDefault();

Expand All @@ -74,7 +76,11 @@ public NodeResource requestResourceInfo(
logger.info("rmWebAddress: " + rmWebAddress);

String queueName = ((YarnResourceIdentifier) identifier).getQueueName();
String realQueueName = "root." + queueName;
if (queueName.startsWith(queuePrefix)) {
logger.info("Queue name {} starts with '{}', remove '{}'", queueName, queuePrefix, queuePrefix);
queueName = queueName.substring(queuePrefix.length());
}
String realQueueName = queuePrefix + queueName;

try {
YarnQueueInfo resources = getResources(rmWebAddress, realQueueName, queueName, provider);
Expand Down Expand Up @@ -301,7 +307,7 @@ public List<ExternalAppInfo> requestAppInfo(
String rmWebAddress = getAndUpdateActiveRmWebAddress(provider);

String queueName = ((YarnResourceIdentifier) identifier).getQueueName();
String realQueueName = "root." + queueName;
String realQueueName = queuePrefix + queueName;

JsonNode resp = getResponseByUrl("apps", rmWebAddress, provider).path("apps").path("app");
if (resp.isMissingNode()) {
Expand Down
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.")

}

0 comments on commit 84df21e

Please sign in to comment.