{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/47632106","id":47632106,"diff_hunk":"@@ -754,6 +538,243 @@ class YarnJobManager(\n       memoryLimit\n     }\n   }\n+\n+  /**\n+    * Heartbeats with the resource manager and handles container updates.\n+    */\n+  object AMRMClientAsyncHandler extends AMRMClientAsync.CallbackHandler {\n+\n+    private var client : AMRMClientAsync[ContainerRequest] = null\n+\n+    override def onError(e: Throwable): Unit = {\n+      self ! decorateMessage(\n+        StopYarnSession(\n+          FinalApplicationStatus.FAILED,\n+          \"Error in communication with Yarn resource manager: \" + e.getMessage)\n+      )\n+    }\n+\n+    override def getProgress: Float = {\n+      runningContainers.toFloat / numTaskManagers\n+    }\n+\n+    override def onShutdownRequest(): Unit = {\n+    }\n+\n+    override def onNodesUpdated(updatedNodes: JavaList[NodeReport]): Unit = {\n+    }\n+\n+    override def onContainersCompleted(statuses: JavaList[ContainerStatus]): Unit = {\n+\n+      // TODO change this","path":"flink-yarn/src/main/scala/org/apache/flink/yarn/YarnJobManager.scala","position":491,"original_position":491,"commit_id":"ed6419de7319ae89c51d1dcee350f490bd5c7d07","original_commit_id":"ed6419de7319ae89c51d1dcee350f490bd5c7d07","user":{"login":"mxm","id":837221,"avatar_url":"https://avatars.githubusercontent.com/u/837221?v=3","gravatar_id":"","url":"https://api.github.com/users/mxm","html_url":"https://github.com/mxm","followers_url":"https://api.github.com/users/mxm/followers","following_url":"https://api.github.com/users/mxm/following{/other_user}","gists_url":"https://api.github.com/users/mxm/gists{/gist_id}","starred_url":"https://api.github.com/users/mxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxm/subscriptions","organizations_url":"https://api.github.com/users/mxm/orgs","repos_url":"https://api.github.com/users/mxm/repos","events_url":"https://api.github.com/users/mxm/events{/privacy}","received_events_url":"https://api.github.com/users/mxm/received_events","type":"User","site_admin":false},"body":"I wanted to remove the debug message here because heartbeat messages are processed in the heartbeat thread and logging a heartbeat on a callback does not really make sense. Thank you.","created_at":"2015-12-15T12:58:10Z","updated_at":"2015-12-15T12:58:10Z","html_url":"https://github.com/apache/flink/pull/1450#discussion_r47632106","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/1450","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/47632106"},"html":{"href":"https://github.com/apache/flink/pull/1450#discussion_r47632106"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/1450"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/1450","id":53403181,"html_url":"https://github.com/apache/flink/pull/1450","diff_url":"https://github.com/apache/flink/pull/1450.diff","patch_url":"https://github.com/apache/flink/pull/1450.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/1450","number":1450,"state":"open","locked":false,"title":"[FLINK-3134][yarn] asynchronous YarnJobManager heartbeats","user":{"login":"mxm","id":837221,"avatar_url":"https://avatars.githubusercontent.com/u/837221?v=3","gravatar_id":"","url":"https://api.github.com/users/mxm","html_url":"https://github.com/mxm","followers_url":"https://api.github.com/users/mxm/followers","following_url":"https://api.github.com/users/mxm/following{/other_user}","gists_url":"https://api.github.com/users/mxm/gists{/gist_id}","starred_url":"https://api.github.com/users/mxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxm/subscriptions","organizations_url":"https://api.github.com/users/mxm/orgs","repos_url":"https://api.github.com/users/mxm/repos","events_url":"https://api.github.com/users/mxm/events{/privacy}","received_events_url":"https://api.github.com/users/mxm/received_events","type":"User","site_admin":false},"body":"- use AMRMClientAsync instead of AMRMClient\r\n- handle allocation and startup of containers in callbacks\r\n- remove YarnHeartbeat message\r\n\r\nThe AMRMClientAsync uses one thread to communicate with the resource\r\nmanager and an additional thread to execute the callbacks.","created_at":"2015-12-11T15:08:24Z","updated_at":"2015-12-15T12:58:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7dcc684cba8010f45dccc550f2f614fea1067292","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/1450/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/1450/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/1450/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/ed6419de7319ae89c51d1dcee350f490bd5c7d07","head":{"label":"mxm:yart-heartbeat-async","ref":"yart-heartbeat-async","sha":"ed6419de7319ae89c51d1dcee350f490bd5c7d07","user":{"login":"mxm","id":837221,"avatar_url":"https://avatars.githubusercontent.com/u/837221?v=3","gravatar_id":"","url":"https://api.github.com/users/mxm","html_url":"https://github.com/mxm","followers_url":"https://api.github.com/users/mxm/followers","following_url":"https://api.github.com/users/mxm/following{/other_user}","gists_url":"https://api.github.com/users/mxm/gists{/gist_id}","starred_url":"https://api.github.com/users/mxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxm/subscriptions","organizations_url":"https://api.github.com/users/mxm/orgs","repos_url":"https://api.github.com/users/mxm/repos","events_url":"https://api.github.com/users/mxm/events{/privacy}","received_events_url":"https://api.github.com/users/mxm/received_events","type":"User","site_admin":false},"repo":{"id":25965625,"name":"flink","full_name":"mxm/flink","owner":{"login":"mxm","id":837221,"avatar_url":"https://avatars.githubusercontent.com/u/837221?v=3","gravatar_id":"","url":"https://api.github.com/users/mxm","html_url":"https://github.com/mxm","followers_url":"https://api.github.com/users/mxm/followers","following_url":"https://api.github.com/users/mxm/following{/other_user}","gists_url":"https://api.github.com/users/mxm/gists{/gist_id}","starred_url":"https://api.github.com/users/mxm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxm/subscriptions","organizations_url":"https://api.github.com/users/mxm/orgs","repos_url":"https://api.github.com/users/mxm/repos","events_url":"https://api.github.com/users/mxm/events{/privacy}","received_events_url":"https://api.github.com/users/mxm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mxm/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/mxm/flink","forks_url":"https://api.github.com/repos/mxm/flink/forks","keys_url":"https://api.github.com/repos/mxm/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mxm/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mxm/flink/teams","hooks_url":"https://api.github.com/repos/mxm/flink/hooks","issue_events_url":"https://api.github.com/repos/mxm/flink/issues/events{/number}","events_url":"https://api.github.com/repos/mxm/flink/events","assignees_url":"https://api.github.com/repos/mxm/flink/assignees{/user}","branches_url":"https://api.github.com/repos/mxm/flink/branches{/branch}","tags_url":"https://api.github.com/repos/mxm/flink/tags","blobs_url":"https://api.github.com/repos/mxm/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mxm/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mxm/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/mxm/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mxm/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/mxm/flink/languages","stargazers_url":"https://api.github.com/repos/mxm/flink/stargazers","contributors_url":"https://api.github.com/repos/mxm/flink/contributors","subscribers_url":"https://api.github.com/repos/mxm/flink/subscribers","subscription_url":"https://api.github.com/repos/mxm/flink/subscription","commits_url":"https://api.github.com/repos/mxm/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/mxm/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/mxm/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/mxm/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/mxm/flink/contents/{+path}","compare_url":"https://api.github.com/repos/mxm/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mxm/flink/merges","archive_url":"https://api.github.com/repos/mxm/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mxm/flink/downloads","issues_url":"https://api.github.com/repos/mxm/flink/issues{/number}","pulls_url":"https://api.github.com/repos/mxm/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/mxm/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/mxm/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mxm/flink/labels{/name}","releases_url":"https://api.github.com/repos/mxm/flink/releases{/id}","created_at":"2014-10-30T10:24:48Z","updated_at":"2015-04-29T12:00:18Z","pushed_at":"2015-12-14T18:10:39Z","git_url":"git://github.com/mxm/flink.git","ssh_url":"git@github.com:mxm/flink.git","clone_url":"https://github.com/mxm/flink.git","svn_url":"https://github.com/mxm/flink","homepage":null,"size":69993,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"61cff8e33191f065bc9f5c35ec126e3662b9eb5f","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-12-15T11:44:28Z","pushed_at":"2015-12-15T12:11:50Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":86552,"stargazers_count":813,"watchers_count":813,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":544,"mirror_url":"git://git.apache.org/flink.git","open_issues_count":68,"forks":544,"open_issues":68,"watchers":813,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/1450"},"html":{"href":"https://github.com/apache/flink/pull/1450"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/1450"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/1450/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/1450/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/1450/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/ed6419de7319ae89c51d1dcee350f490bd5c7d07"}}}}