[
https://issues.apache.org/jira/browse/YARN-9206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16749132#comment-16749132
]
Jim Brennan commented on YARN-9206:
-----------------------------------
{quote}{quote}I think you need to iterate the acceptedStates() and call
isInactiveState() on each one to determine if it contains one.
{quote}
Yes, this was something I was trying to avoid as EnumSet.contains at least in
my understanding is faster than iterating over elements of the enum set.
{quote}
I'm sure that is true, but in this case I'm not sure if it's significant
enough? There are likely only a few states in acceptedStates(), and you can
also early out as soon as you find one that matches.
If we add a NodeState.isActive() as well, then you could iterate acceptedStates
once to determine both.
> RMServerUtils does not count SHUTDOWN as an accepted state
> ----------------------------------------------------------
>
> Key: YARN-9206
> URL: https://issues.apache.org/jira/browse/YARN-9206
> Project: Hadoop YARN
> Issue Type: Bug
> Affects Versions: 3.0.3
> Reporter: Kuhu Shukla
> Assignee: Kuhu Shukla
> Priority: Major
> Attachments: YARN-9206.001.patch, YARN-9206.002.patch
>
>
> {code}
> if (acceptedStates.contains(NodeState.DECOMMISSIONED) ||
> acceptedStates.contains(NodeState.LOST) ||
> acceptedStates.contains(NodeState.REBOOTED)) {
> for (RMNode rmNode : context.getInactiveRMNodes().values()) {
> if ((rmNode != null) && acceptedStates.contains(rmNode.getState())) {
> results.add(rmNode);
> }
> }
> }
> return results;
> }
> {code}
> This should include SHUTDOWN state as they are inactive too. This method is
> used for node reports and such so might be useful to account for them as well.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]