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

Peter Bacsko commented on YARN-9780:
------------------------------------

[~Prabhu Joseph] I have some minor comments:

#1 Nit: pay attention the missing white spaces
{noformat}
String newQueueState = newConf.get(configPrefix+"state");
{noformat}
 

#2 I suggest the following piece of code to retrieve {{newQueueState}} with 
error handling:
{noformat}
                  String configPrefix = newConf.getQueuePrefix(
                      oldQueue.getQueuePath());
                      
                   try {
                     QueueState newQueueState = QueueState.valueOf(
                       newConf.get(configPrefix + "state"));
                   } catch (IllegalArgumentException) {
                           // handle illegal string for state
                   }

                    // no need to null check newQueueState
                    if (oldQueue.getState() == QueueState.STOPPED ||
                       newQueueState != QueueState.STOPPED) {
                    ...{noformat}
#3 Nit: add some (or more) meaningful assertion messages:
{noformat}
assertEquals(1, newCSConf.getQueues("root.a").length);
assertEquals("a1", newCSConf.getQueues("root.a")[0]);{noformat}

> SchedulerConf Mutation Api does not Allow Stop and Remove Queue in a single 
> call
> --------------------------------------------------------------------------------
>
>                 Key: YARN-9780
>                 URL: https://issues.apache.org/jira/browse/YARN-9780
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: capacity scheduler
>    Affects Versions: 3.3.0
>            Reporter: Prabhu Joseph
>            Assignee: Prabhu Joseph
>            Priority: Major
>         Attachments: YARN-9780-001.patch, YARN-9780-002.patch, 
> YARN-9780-003.patch
>
>
> SchedulerConf Mutation Api does not Allow Stop and Remove Queue in a single 
> call. The queue has to be stopped before removing and so it is useful to 
> allow both Stop and remove queue in a single call.
> *Repro:*
> {code:java}
> Capacity-Scheduler.xml:
> yarn.scheduler.capacity.root.queues = new, default, dummy
> yarn.scheduler.capacity.root.default.capacity = 60
> yarn.scheduler.capacity.root.dummy.capacity = 30
> yarn.scheduler.capacity.root.new.capacity = 10   
> curl -v -X PUT -d @abc.xml -H "Content-type: application/xml" 
> 'http://<RM_IP>:8088/ws/v1/cluster/scheduler-conf'
> abc.xml
> <sched-conf>
>       <update-queue>
>           <queue-name>root.default</queue-name>
>           <params>
>             <entry>
>               <key>capacity</key>
>               <value>70</value>
>             </entry>
>           </params>
>         </update-queue>
>         <update-queue>
>           <queue-name>root.new</queue-name>
>           <params>
>             <entry>
>               <key>state</key>
>               <value>STOPPED</value>
>             </entry>
>           </params>
>         </update-queue>
>         <remove-queue>root.new</remove-queue>
>       </sched-conf>  
>  {code}



--
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