[
https://issues.apache.org/jira/browse/SAMZA-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13961702#comment-13961702
]
Zhijie Shen commented on SAMZA-58:
----------------------------------
Chris, thanks for reviewing and testing the patch!
W.R.T (2), I understand it seems to be weird to have such a dummy loop.
However, the tricky part is that AMRClientAsyncImpl has a non-daemon thread
(given the threat that creates amClient is non-daemon) to do heartbeat with
ResourceManager, and a daemon thread to invoke the right callback. Given main
thread is not trapped in the loop, when any error happens on the heartbeat
thread or ResourceManager notify AM of resync or shutdown, the heartbeat thread
is to exit, and the process is to exit as all non-daemon thread have exited,
such that the callback to stop listeners and stop amClient may have a chance to
execute.
I didn't know many applications, but I saw that the demonstrating application:
distributed shell is sitting in a loop in the main thread until the finish
condition is met.
> Use YARN's AMRMClientAsync client library
> -----------------------------------------
>
> Key: SAMZA-58
> URL: https://issues.apache.org/jira/browse/SAMZA-58
> Project: Samza
> Issue Type: Bug
> Components: yarn
> Affects Versions: 0.6.0
> Reporter: Chris Riccomini
> Assignee: Zhijie Shen
> Attachments: SAMZA-58.1.patch
>
>
> YARN 2.2.0 has a nice Async API for clients and AMs. This API didn't exist
> when we did the initial YARN integration for Samza. We should upgrade Samza
> to use these new APIs.
> The API is loosely based off Samza's own AM code, so we can probably strip
> out a lot of it (YarnAppMaster, mainly), and switch everything over to the
> call-back based API.
> For details, see:
> https://issues.apache.org/jira/browse/YARN-417
> This new API is used in DistributedShell now, so we can use that for testing.
--
This message was sent by Atlassian JIRA
(v6.2#6252)