{"action":"created","comment":{"url":"https://api.github.com/repos/apache/reef/pulls/comments/88968311","pull_request_review_id":9523180,"id":88968311,"diff_hunk":"@@ -0,0 +1,389 @@\n+﻿// Licensed to the Apache Software Foundation (ASF) under one\n+// or more contributor license agreements.  See the NOTICE file\n+// distributed with this work for additional information\n+// regarding copyright ownership.  The ASF licenses this file\n+// to you under the Apache License, Version 2.0 (the\n+// \"License\"); you may not use this file except in compliance\n+// with the License.  You may obtain a copy of the License at\n+//\n+//   http://www.apache.org/licenses/LICENSE-2.0\n+// \n+// Unless required by applicable law or agreed to in writing,\n+// software distributed under the License is distributed on an\n+// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+// KIND, either express or implied.  See the License for the\n+// specific language governing permissions and limitations\n+// under the License.\n+\n+using System;\n+using System.Collections.Generic;\n+using System.Globalization;\n+using System.IO;\n+using System.Linq;\n+using Org.Apache.REEF.Common.Tasks;\n+using Org.Apache.REEF.IMRU.API;\n+using Org.Apache.REEF.IMRU.OnREEF.IMRUTasks;\n+using Org.Apache.REEF.IMRU.OnREEF.Parameters;\n+using Org.Apache.REEF.Tang.Annotations;\n+using Org.Apache.REEF.Tang.Implementations.Configuration;\n+using Org.Apache.REEF.Tang.Implementations.Tang;\n+using Org.Apache.REEF.Tang.Interface;\n+using Org.Apache.REEF.Tang.Util;\n+using Org.Apache.REEF.Utilities.Logging;\n+using System.Threading;\n+\n+namespace Org.Apache.REEF.IMRU.Examples.PipelinedBroadcastReduce\n+{\n+    /// <summary>\n+    /// IMRU program that performs broadcast and reduce with fault tolerance.\n+    /// </summary>\n+    public sealed class PipelinedBroadcastAndReduceWithRandomFailures : PipelinedBroadcastAndReduce\n+    {\n+        private static readonly Logger Logger = Logger.GetLogger(typeof(PipelinedBroadcastAndReduceWithRandomFailures));\n+\n+        [Inject]\n+        private PipelinedBroadcastAndReduceWithRandomFailures(IIMRUClient imruClient) : base(imruClient)\n+        {\n+        }\n+\n+        /// <summary>\n+        /// Runs the actual broadcast and reduce job with fault tolerance\n+        /// </summary>\n+        internal void Run(int numberofMappers, int chunkSize, int numIterations, int dim, int mapperMemory, int updateTaskMemory, \n+            int maxRetryNumberInRecovery, float failProb, int minTimeoutInSec, int expThroughput)\n+        {\n+            var results = _imruClient.Submit<int[], int[], int[], Stream>(\n+                CreateJobDefinitionBuilder(numberofMappers, chunkSize, numIterations, dim, mapperMemory, updateTaskMemory)\n+                    .SetMapFunctionConfiguration(BuildMapperFunctionConfig(dim, failProb, minTimeoutInSec, expThroughput))\n+                    .SetMaxRetryNumberInRecovery(maxRetryNumberInRecovery)\n+                    .Build());\n+        }\n+\n+        protected override IMRUJobDefinitionBuilder CreateJobDefinitionBuilder(int numberofMappers, int chunkSize, int numIterations, int dim, int mapperMemory, int updateTaskMemory)\n+        {\n+            return new IMRUJobDefinitionBuilder()\n+                    .SetUpdateTaskStateConfiguration(UpdateTaskStateConfiguration())\n+                    .SetMapTaskStateConfiguration(MapTaskStateConfiguration())\n+                    .SetUpdateFunctionConfiguration(UpdateFunctionConfig(numberofMappers, numIterations, dim))\n+                    .SetMapInputCodecConfiguration(MapInputCodecConfiguration())\n+                    .SetUpdateFunctionCodecsConfiguration(UpdateFunctionCodecsConfiguration())\n+                    .SetReduceFunctionConfiguration(ReduceFunctionConfiguration())\n+                    .SetMapInputPipelineDataConverterConfiguration(MapInputDataConverterConfig(chunkSize))\n+                    .SetMapOutputPipelineDataConverterConfiguration(MapOutputDataConverterConfig(chunkSize))\n+                    .SetPartitionedDatasetConfiguration(PartitionedDatasetConfiguration(numberofMappers))\n+                    .SetJobName(\"BroadcastReduce\")","path":"lang/cs/Org.Apache.REEF.IMRU.Examples/PipelinedBroadcastReduce/PipelinedBroadcastAndReduceWithRandomFailures.cs","position":74,"original_position":74,"commit_id":"620ac34eaf717ef2c2988103b21b1d88a07157af","original_commit_id":"620ac34eaf717ef2c2988103b21b1d88a07157af","user":{"login":"markusweimer","id":502371,"avatar_url":"https://avatars.githubusercontent.com/u/502371?v=3","gravatar_id":"","url":"https://api.github.com/users/markusweimer","html_url":"https://github.com/markusweimer","followers_url":"https://api.github.com/users/markusweimer/followers","following_url":"https://api.github.com/users/markusweimer/following{/other_user}","gists_url":"https://api.github.com/users/markusweimer/gists{/gist_id}","starred_url":"https://api.github.com/users/markusweimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markusweimer/subscriptions","organizations_url":"https://api.github.com/users/markusweimer/orgs","repos_url":"https://api.github.com/users/markusweimer/repos","events_url":"https://api.github.com/users/markusweimer/events{/privacy}","received_events_url":"https://api.github.com/users/markusweimer/received_events","type":"User","site_admin":false},"body":"It is probably best to add `WithRandomFailure` here? That way, we see in the YARN app list what is going on.","created_at":"2016-11-21T19:23:22Z","updated_at":"2016-11-21T19:28:51Z","html_url":"https://github.com/apache/reef/pull/1186#discussion_r88968311","pull_request_url":"https://api.github.com/repos/apache/reef/pulls/1186","_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/comments/88968311"},"html":{"href":"https://github.com/apache/reef/pull/1186#discussion_r88968311"},"pull_request":{"href":"https://api.github.com/repos/apache/reef/pulls/1186"}}},"pull_request":{"url":"https://api.github.com/repos/apache/reef/pulls/1186","id":94467382,"html_url":"https://github.com/apache/reef/pull/1186","diff_url":"https://github.com/apache/reef/pull/1186.diff","patch_url":"https://github.com/apache/reef/pull/1186.patch","issue_url":"https://api.github.com/repos/apache/reef/issues/1186","number":1186,"state":"open","locked":false,"title":"[REEF-1674] Random Failures in Broadcast and Reduce Fault Tolerance t…","user":{"login":"shravanmn","id":149595,"avatar_url":"https://avatars.githubusercontent.com/u/149595?v=3","gravatar_id":"","url":"https://api.github.com/users/shravanmn","html_url":"https://github.com/shravanmn","followers_url":"https://api.github.com/users/shravanmn/followers","following_url":"https://api.github.com/users/shravanmn/following{/other_user}","gists_url":"https://api.github.com/users/shravanmn/gists{/gist_id}","starred_url":"https://api.github.com/users/shravanmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shravanmn/subscriptions","organizations_url":"https://api.github.com/users/shravanmn/orgs","repos_url":"https://api.github.com/users/shravanmn/repos","events_url":"https://api.github.com/users/shravanmn/events{/privacy}","received_events_url":"https://api.github.com/users/shravanmn/received_events","type":"User","site_admin":false},"body":"…ests\r\n\r\n  This adds a class PipelinedBroadcastAndReduceWithRandomFailures which introduces a random failure model\r\n  controlled by parameters FailureProbability, MinTimeoutInSec, ExpectedThroughput\r\n\r\nJIRA:\r\n  [REEF-1674](https://issues.apache.org/jira/browse/REEF-1674)\r\n\r\nPull Request:\r\n  Closes #","created_at":"2016-11-19T02:35:10Z","updated_at":"2016-11-21T19:28:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1225945db749e540cd4ab1fad4ca9e7c47d6a3c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/reef/pulls/1186/commits","review_comments_url":"https://api.github.com/repos/apache/reef/pulls/1186/comments","review_comment_url":"https://api.github.com/repos/apache/reef/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/reef/issues/1186/comments","statuses_url":"https://api.github.com/repos/apache/reef/statuses/620ac34eaf717ef2c2988103b21b1d88a07157af","head":{"label":"shravanmn:REEF-1674","ref":"REEF-1674","sha":"620ac34eaf717ef2c2988103b21b1d88a07157af","user":{"login":"shravanmn","id":149595,"avatar_url":"https://avatars.githubusercontent.com/u/149595?v=3","gravatar_id":"","url":"https://api.github.com/users/shravanmn","html_url":"https://github.com/shravanmn","followers_url":"https://api.github.com/users/shravanmn/followers","following_url":"https://api.github.com/users/shravanmn/following{/other_user}","gists_url":"https://api.github.com/users/shravanmn/gists{/gist_id}","starred_url":"https://api.github.com/users/shravanmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shravanmn/subscriptions","organizations_url":"https://api.github.com/users/shravanmn/orgs","repos_url":"https://api.github.com/users/shravanmn/repos","events_url":"https://api.github.com/users/shravanmn/events{/privacy}","received_events_url":"https://api.github.com/users/shravanmn/received_events","type":"User","site_admin":false},"repo":{"id":51896472,"name":"reef","full_name":"shravanmn/reef","owner":{"login":"shravanmn","id":149595,"avatar_url":"https://avatars.githubusercontent.com/u/149595?v=3","gravatar_id":"","url":"https://api.github.com/users/shravanmn","html_url":"https://github.com/shravanmn","followers_url":"https://api.github.com/users/shravanmn/followers","following_url":"https://api.github.com/users/shravanmn/following{/other_user}","gists_url":"https://api.github.com/users/shravanmn/gists{/gist_id}","starred_url":"https://api.github.com/users/shravanmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shravanmn/subscriptions","organizations_url":"https://api.github.com/users/shravanmn/orgs","repos_url":"https://api.github.com/users/shravanmn/repos","events_url":"https://api.github.com/users/shravanmn/events{/privacy}","received_events_url":"https://api.github.com/users/shravanmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shravanmn/reef","description":"Mirror of Apache REEF","fork":true,"url":"https://api.github.com/repos/shravanmn/reef","forks_url":"https://api.github.com/repos/shravanmn/reef/forks","keys_url":"https://api.github.com/repos/shravanmn/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shravanmn/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shravanmn/reef/teams","hooks_url":"https://api.github.com/repos/shravanmn/reef/hooks","issue_events_url":"https://api.github.com/repos/shravanmn/reef/issues/events{/number}","events_url":"https://api.github.com/repos/shravanmn/reef/events","assignees_url":"https://api.github.com/repos/shravanmn/reef/assignees{/user}","branches_url":"https://api.github.com/repos/shravanmn/reef/branches{/branch}","tags_url":"https://api.github.com/repos/shravanmn/reef/tags","blobs_url":"https://api.github.com/repos/shravanmn/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shravanmn/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shravanmn/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/shravanmn/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shravanmn/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/shravanmn/reef/languages","stargazers_url":"https://api.github.com/repos/shravanmn/reef/stargazers","contributors_url":"https://api.github.com/repos/shravanmn/reef/contributors","subscribers_url":"https://api.github.com/repos/shravanmn/reef/subscribers","subscription_url":"https://api.github.com/repos/shravanmn/reef/subscription","commits_url":"https://api.github.com/repos/shravanmn/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/shravanmn/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/shravanmn/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/shravanmn/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/shravanmn/reef/contents/{+path}","compare_url":"https://api.github.com/repos/shravanmn/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shravanmn/reef/merges","archive_url":"https://api.github.com/repos/shravanmn/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shravanmn/reef/downloads","issues_url":"https://api.github.com/repos/shravanmn/reef/issues{/number}","pulls_url":"https://api.github.com/repos/shravanmn/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/shravanmn/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/shravanmn/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shravanmn/reef/labels{/name}","releases_url":"https://api.github.com/repos/shravanmn/reef/releases{/id}","deployments_url":"https://api.github.com/repos/shravanmn/reef/deployments","created_at":"2016-02-17T05:12:28Z","updated_at":"2016-02-17T05:12:38Z","pushed_at":"2016-11-19T02:33:16Z","git_url":"git://github.com/shravanmn/reef.git","ssh_url":"git@github.com:shravanmn/reef.git","clone_url":"https://github.com/shravanmn/reef.git","svn_url":"https://github.com/shravanmn/reef","homepage":"","size":38236,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"4e4e568faa3c3d625433b17bb4d15e0cd7897d7a","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":25623941,"name":"reef","full_name":"apache/reef","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/reef","description":"Mirror of Apache REEF","fork":false,"url":"https://api.github.com/repos/apache/reef","forks_url":"https://api.github.com/repos/apache/reef/forks","keys_url":"https://api.github.com/repos/apache/reef/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/reef/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/reef/teams","hooks_url":"https://api.github.com/repos/apache/reef/hooks","issue_events_url":"https://api.github.com/repos/apache/reef/issues/events{/number}","events_url":"https://api.github.com/repos/apache/reef/events","assignees_url":"https://api.github.com/repos/apache/reef/assignees{/user}","branches_url":"https://api.github.com/repos/apache/reef/branches{/branch}","tags_url":"https://api.github.com/repos/apache/reef/tags","blobs_url":"https://api.github.com/repos/apache/reef/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/reef/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/reef/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/reef/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/reef/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/reef/languages","stargazers_url":"https://api.github.com/repos/apache/reef/stargazers","contributors_url":"https://api.github.com/repos/apache/reef/contributors","subscribers_url":"https://api.github.com/repos/apache/reef/subscribers","subscription_url":"https://api.github.com/repos/apache/reef/subscription","commits_url":"https://api.github.com/repos/apache/reef/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/reef/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/reef/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/reef/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/reef/contents/{+path}","compare_url":"https://api.github.com/repos/apache/reef/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/reef/merges","archive_url":"https://api.github.com/repos/apache/reef/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/reef/downloads","issues_url":"https://api.github.com/repos/apache/reef/issues{/number}","pulls_url":"https://api.github.com/repos/apache/reef/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/reef/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/reef/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/reef/labels{/name}","releases_url":"https://api.github.com/repos/apache/reef/releases{/id}","deployments_url":"https://api.github.com/repos/apache/reef/deployments","created_at":"2014-10-23T07:00:10Z","updated_at":"2016-11-11T18:26:45Z","pushed_at":"2016-11-21T19:11:44Z","git_url":"git://github.com/apache/reef.git","ssh_url":"git@github.com:apache/reef.git","clone_url":"https://github.com/apache/reef.git","svn_url":"https://github.com/apache/reef","homepage":"","size":51894,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":"git://git.apache.org/reef.git","open_issues_count":7,"forks":70,"open_issues":7,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/reef/pulls/1186"},"html":{"href":"https://github.com/apache/reef/pull/1186"},"issue":{"href":"https://api.github.com/repos/apache/reef/issues/1186"},"comments":{"href":"https://api.github.com/repos/apache/reef/issues/1186/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/reef/pulls/1186/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/reef/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/reef/pulls/1186/commits"},"statuses":{"href":"https://api.github.com/repos/apache/reef/statuses/620ac34eaf717ef2c2988103b21b1d88a07157af"}}}}
{"actor":{"display_login":"markusweimer"}}