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: root.xxx适配 #678

Merged
merged 7 commits into from
Dec 13, 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 @@ -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.")

}
Loading