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 "Szilard Nemeth (Jira)" <ji...@apache.org> on 2022/02/22 13:43:00 UTC

[jira] [Updated] (YARN-10994) Remove the clusterResource param from RMNodeLabelsManager.getResourceByLabel

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

Szilard Nemeth updated YARN-10994:
----------------------------------
        Parent:     (was: YARN-10889)
    Issue Type: Bug  (was: Sub-task)

> Remove the clusterResource param from RMNodeLabelsManager.getResourceByLabel
> ----------------------------------------------------------------------------
>
>                 Key: YARN-10994
>                 URL: https://issues.apache.org/jira/browse/YARN-10994
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Benjamin Teke
>            Priority: Major
>
> RMNodeLabelsManager.getResourceByLabel has currently two parameters: String label and Resource clusterResource. The latter however is only used by tests during mocking: the parameter supplied in the production code by the callers are returned in tests. See ReservationSystemTestUtil.createRMContext:
> {code:java}
> ...
>  when(nlm.getResourceByLabel(any(), any(Resource.class)))
>         .thenAnswer(new Answer<Resource>() {
>           @Override
>           public Resource answer(InvocationOnMock invocation) throws Throwable {
>             Object[] args = invocation.getArguments();
>             return (Resource) args[1];
>           }
>         });
> ...
> {code}
> This is misleading and hard to understand (no way of knowing with what values are the clusterResources mocked by looking at the tests) and generates unnecessary production code so it should be removed and the tests should be properly mocked.



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