[ 
https://issues.apache.org/jira/browse/YARN-10506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263118#comment-17263118
 ] 

zhuqi edited comment on YARN-10506 at 1/12/21, 7:08 AM:
--------------------------------------------------------

[~wangda] [~gandras]

Update a patch to fix two problem:
 # Fix autoCreateLeafQueue to use path , the logic change to 

{code:java}
@VisibleForTesting
protected LeafQueue autoCreateLeafQueue(
    ApplicationPlacementContext placementContext)
    throws IOException, YarnException {
  String leafQueueName = placementContext.getQueue();
  String parentQueueName = placementContext.getParentQueue();

  if (!StringUtils.isEmpty(parentQueueName)) {
    CSQueue parentQueue = getQueue(parentQueueName);
    if (parentQueue == null) {
      throw new SchedulerDynamicEditException(
          "Could not auto-create leaf queue for " + leafQueueName
              + ". Queue mapping specifies an invalid parent queue "
              + "which does not exist " + parentQueueName);
    }

    if (conf.isAutoCreateChildQueueEnabled(parentQueue.getQueuePath())) {
        // Case 1: Handle ManagedParentQueue
        AutoCreatedLeafQueue autoCreatedLeafQueue = null;
        ManagedParentQueue autoCreateEnabledParentQueue =
            (ManagedParentQueue) parentQueue;
        autoCreatedLeafQueue = new AutoCreatedLeafQueue(this, leafQueueName,
            autoCreateEnabledParentQueue);

        addQueue(autoCreatedLeafQueue);
        return autoCreatedLeafQueue;

    } else {
      try {
        writeLock.lock();
        LeafQueue lq = autoQueueHandler.autoCreateQueuePath(placementContext);
      } finally {
        writeLock.unlock();
      }
    }
  }

  throw new SchedulerDynamicEditException(
      "Could not auto-create leaf queue for " + leafQueueName
          + ". Queue mapping does not specify"
          + " which parent queue it needs to be created under.");
}
{code}
 # Fix testActivateApplicationAfterQueueRefresh in testLeafQueue to update 
active apps use update, because of reinitialize remove active application logic:

{code:java}
// This will not update active apps
root.reinitialize(newRoot, csContext.getClusterResource());
// Cause this to update active apps
root.updateClusterResource(csContext.getClusterResource(),
    new ResourceLimits(csContext.getClusterResource()));
{code}
Thanks.

 


was (Author: zhuqi):
[~wangda] [~gandras]

Update a patch to fix two problem:
 # Fix autoCreateLeafQueue to use path , the logic change to 

{code:java}
@VisibleForTesting
protected LeafQueue autoCreateLeafQueue(
    ApplicationPlacementContext placementContext)
    throws IOException, YarnException {
  String leafQueueName = placementContext.getQueue();
  String parentQueueName = placementContext.getParentQueue();

  if (!StringUtils.isEmpty(parentQueueName)) {
    CSQueue parentQueue = getQueue(parentQueueName);
    if (parentQueue == null) {
      throw new SchedulerDynamicEditException(
          "Could not auto-create leaf queue for " + leafQueueName
              + ". Queue mapping specifies an invalid parent queue "
              + "which does not exist " + parentQueueName);
    }

    if (conf.isAutoCreateChildQueueEnabled(parentQueue.getQueuePath())) {
        // Case 1: Handle ManagedParentQueue
        AutoCreatedLeafQueue autoCreatedLeafQueue = null;
        ManagedParentQueue autoCreateEnabledParentQueue =
            (ManagedParentQueue) parentQueue;
        autoCreatedLeafQueue = new AutoCreatedLeafQueue(this, leafQueueName,
            autoCreateEnabledParentQueue);

        addQueue(autoCreatedLeafQueue);
        return autoCreatedLeafQueue;

    } else {
      try {
        writeLock.lock();
        LeafQueue lq = autoQueueHandler.autoCreateQueuePath(placementContext);
      } finally {
        writeLock.unlock();
      }
    }
  }

  throw new SchedulerDynamicEditException(
      "Could not auto-create leaf queue for " + leafQueueName
          + ". Queue mapping does not specify"
          + " which parent queue it needs to be created under.");
}
{code}

 # Fix testActivateApplicationAfterQueueRefresh in testLeafQueue to update 
active apps use update:

{code:java}
// This will not update active apps
root.reinitialize(newRoot, csContext.getClusterResource());
// Cause this to update active apps
root.updateClusterResource(csContext.getClusterResource(),
    new ResourceLimits(csContext.getClusterResource()));
{code}

Thanks.

 

> Update queue creation logic to use weight mode and allow the flexible 
> static/dynamic creation
> ---------------------------------------------------------------------------------------------
>
>                 Key: YARN-10506
>                 URL: https://issues.apache.org/jira/browse/YARN-10506
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Benjamin Teke
>            Assignee: Andras Gyori
>            Priority: Major
>         Attachments: YARN-10506-006-10504-010.patch, 
> YARN-10506-007-10504-010.patch, YARN-10506-008.patch, YARN-10506.001.patch, 
> YARN-10506.002.patch, YARN-10506.003.patch, YARN-10506.004.patch, 
> YARN-10506.005.patch, YARN-10506.006-combined.patch, YARN-10506.006.patch, 
> YARN-10506.007.patch
>
>
> The queue creation logic should be updated to use weight mode and support the 
> flexible creation. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to