You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Gergely Pollák (Jira)" <ji...@apache.org> on 2021/12/16 14:57:00 UTC

[jira] [Commented] (YARN-11048) Add tests that shows how to delete config values with Mutation API

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

Gergely Pollák commented on YARN-11048:
---------------------------------------

[~snemeth] thank you for working on this, merged to trunk. [~bteke] thank you for the review!

> Add tests that shows how to delete config values with Mutation API
> ------------------------------------------------------------------
>
>                 Key: YARN-11048
>                 URL: https://issues.apache.org/jira/browse/YARN-11048
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: capacity scheduler, restapi
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> There are no tests that really show how to delete configs via the Mutation API. 
> I discovered that null values coming in the global conf update of the SchedConfUpdateInfo DTO class will be translated to an action that deletes the config from the Configuration object.
> The request field of this global config map is called "global-updates" and the corresponding code is [here|https://github.com/apache/hadoop/blob/09c5dfe937f0570cd9494b34d210df2d5f0737a7/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/dao/SchedConfUpdateInfo.java#L47].
> See the code fragment of MutableCSConfigurationProvider that deletes the configuration: [here|https://github.com/apache/hadoop/blob/d336227e5c63a70db06ac26697994c96ed89d230/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/conf/MutableCSConfigurationProvider.java#L163-L171]
> A good candidate class would be: TestRMWebServicesConfigurationMutation.
> Here, we can add a testcase that does some Node label related API actions, as when deleting node labels and de-assigning the capacities from labels and queues, some residual config will stay in the Configuration object, so it's easy to show what's going on and how to get rid of those configs.
> The testcase should perform the following: 
> 1. Create a node label by calling the "add-node-labels" endpoint.
> 2. Verify that the node label is created by calling the "get-node-labels" endpoint
> 3. Assign some queues to the new label
> 4. Set partition capacities to queues
> 5. Verify if the capacities are applied to the partitions.
> 6. De-assign node label from the queues + remove the residual configs by sending empty strings or null values. Basically, this is inverting the configs set by step 3.
> 7. Remove the node label
> 8. Check if the residual configs are in the Configuration object. They shouldn't be in it.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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