Anubhav Dhoot commented on YARN-4143:

Copying comments from YARN-2005
Sunil G added a comment - 03/Sep/15 07:17
Hi Anubhav Dhoot
Thank you for updating the patch. I have a comment here.
isWaitingForAMContainer is now used in 2 cases. To set the ContainerType and 
also in blacklist case. And this check is now hitting in every heartbeat from 
I think its better to set a state called amIsStarted in 
SchedulerApplicationAttempt. And this can be set from 2 places.
1. RMAppAttemptImpl#AMContainerAllocatedTransition can call a new scheduler api 
to set amIsStarted flag when AM Container is launched and registered. We need 
to pass ContainerId to this new api to get attempt object and to set the flag.
2. AbstrctYarnScheduler#recoverContainersOnNode can also invoke this api to set 
this flag.
So now we can directly read from SchedulerApplicationAttempt everytime when 
heartbeat call comes from AM. If we are not doing this in this ticket, I can 
open another ticket for this optimization. Please suggest your thoughts.

> Optimize the check for AMContainer allocation needed by blacklisting and 
> ContainerType
> --------------------------------------------------------------------------------------
>                 Key: YARN-4143
>                 URL: https://issues.apache.org/jira/browse/YARN-4143
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Anubhav Dhoot
>            Assignee: Anubhav Dhoot
> In YARN-2005 there are checks made to determine if the allocation is for an 
> AM container. This happens in every allocate call and should be optimized 
> away since it changes only once per SchedulerApplicationAttempt

This message was sent by Atlassian JIRA

Reply via email to