[ 
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to