[ 
https://issues.apache.org/jira/browse/YARN-11048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shilun Fan updated YARN-11048:
------------------------------
    Affects Version/s: 3.4.0

> 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
>    Affects Versions: 3.4.0
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>          Time Spent: 1h 40m
>  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.10#820010)

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