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

Peter Szucs commented on YARN-10905:
------------------------------------

As I saw in my investigation, _configuredNodeLabels_ method is extracted to 
_NodeLabelsSettings_ class since the ticket was issued. In the 
_AbstractCSQueue's_ _setupQueueConfigs_ method we load the 
_queueNodeLabelsSettings_ and the _queueCapacities_ every time we refresh a 
queue. The process of this is the following:
 * we initialize the _queueNodeLabelsSettings_ and read all the node label 
informations (accessible/configured node labels, defaultLabelExpression) from 
the config. We store _configuredNodeLabels_ as a set of strings here.
 * after this we initialize the _queueCapacities_ map with iterating through 
the _configuredNodeLabels_ and reading the capacity properties for each label 
for a given queue from the config.
 * _QueueCapacities#getExistingNodeLabels_ returns the keyset of this map

Since we are iterating through the 
_queueNodeLabelsSettings#configuredNodeLabels_ and creating another map from it 
for the detailed capacities, _configuredNodeLabels_ and 
_QueueCapacities#getExistingNodeLabels_ should return the same set of labels.

*Conclusion:*

_QueueCapacities_ needs the _configuredNodeLabels_ for the initialization, so I 
think the only thing that can be removed is the 
_QueueCapacities#getExistingNodeLabels_ method, but I think it's reasonable to 
have a method in _QueueCapacities_ to retrieve the keyset of the capacities map 
for code parts that are dealing with only the {_}QueueCapacities{_}, for 
example {_}QueueCapacitiesInfo{_}, or _mergeCapacities_ in the 
{_}AutoCreatedLeafQueue{_}, where we are creating one capacity map from 
another, so I haven't found a nice way to clean this up yet.

> Investigate if AbstractCSQueue#configuredNodeLabels vs. 
> QueueCapacities#getExistingNodeLabels holds the same data
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: YARN-10905
>                 URL: https://issues.apache.org/jira/browse/YARN-10905
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Szilard Nemeth
>            Assignee: Peter Szucs
>            Priority: Minor
>
> The task is to investigate whether the field 
> AbstractCSQueue#configuredNodeLabels holds the same data as 
> QueueCapacities#getExistingNodeLabels.
> Obviously, we don't want double-entry bookkeeping so if the data is the same, 
> we can remove this or that.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to