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

Chris Riccomini commented on YARN-417:
--------------------------------------

Hey Sandy,

I think skipping onInit and onShutdown is fine. That stuff can be handled in 
the method that's actually instantiating/running the heartbeater.

So, to be concise: onReboot, onContainerLost (-100 return code), 
onContainerFailed (return code != 0 and != -100), onContainerSuccess (0 return 
code), onContainerAllocated. One other callback that is worth considering is 
onContainerOutOfMemory (-1 return code). I'm not sure how fine grained we want 
to get, but all these nuanced return codes that are hidden in the Java docs and 
whatnot make it difficult to write AMs. Doing as much work as possible for the 
framework developer would be a nice thing, in my opinion.

One thing that we need to be careful about is how a user would request 
containers using this callback approach and the AMRM. This line, from the 
Javadocs, scares me, "App should not make concurrent allocate requests. May 
cause request loss." I think this means that AMRMClient.allocate can only be 
called in the heartbeat loop, and the user should use 
AMRMClient.addContainerRequest and AMRMClient.releaseAssignedContainer in the 
callbacks whenever it wants to get or release new containers. Bikas, is this a 
correct reading?

Cheers,
Chris
                
> Add a poller that allows the AM to receive notifications when it is assigned 
> containers
> ---------------------------------------------------------------------------------------
>
>                 Key: YARN-417
>                 URL: https://issues.apache.org/jira/browse/YARN-417
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: api, applications
>    Affects Versions: 2.0.3-alpha
>            Reporter: Sandy Ryza
>            Assignee: Sandy Ryza
>         Attachments: YARN-417.patch, YarnAppMaster.java, 
> YarnAppMasterListener.java
>
>
> Writing AMs would be easier for some if they did not have to handle 
> heartbeating to the RM on their own.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to