{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/62409933","id":62409933,"diff_hunk":"@@ -637,11 +639,12 @@ private[log] class Cleaner(val id: Int,\n    * @param segment The segment to index\n    * @param map The map in which to store the key=>offset mapping\n    *\n-   * @return The final offset covered by the map\n+   * @return The final offset covered by the map or -1 if the map is full\n    */\n   private def buildOffsetMapForSegment(topicAndPartition: TopicAndPartition, segment: LogSegment, map: OffsetMap): Long = {\n     var position = 0\n     var offset = segment.baseOffset\n+    val maxDesiredMapSize = (map.slots * this.dupBufferLoadFactor).toInt","path":"core/src/main/scala/kafka/log/LogCleaner.scala","position":36,"original_position":36,"commit_id":"e4f4e5ed75a845f0c4cc2b6745dc213f71affe6d","original_commit_id":"e4f4e5ed75a845f0c4cc2b6745dc213f71affe6d","user":{"login":"alekar","id":4992761,"avatar_url":"https://avatars.githubusercontent.com/u/4992761?v=3","gravatar_id":"","url":"https://api.github.com/users/alekar","html_url":"https://github.com/alekar","followers_url":"https://api.github.com/users/alekar/followers","following_url":"https://api.github.com/users/alekar/following{/other_user}","gists_url":"https://api.github.com/users/alekar/gists{/gist_id}","starred_url":"https://api.github.com/users/alekar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekar/subscriptions","organizations_url":"https://api.github.com/users/alekar/orgs","repos_url":"https://api.github.com/users/alekar/repos","events_url":"https://api.github.com/users/alekar/events{/privacy}","received_events_url":"https://api.github.com/users/alekar/received_events","type":"User","site_admin":false},"body":"Is ```dupBufferLoadFactor``` useful after this change? You could modify ```OffsetMap.put``` to return ```Boolean``` to indicate if the put worked or map was full.","created_at":"2016-05-07T02:24:27Z","updated_at":"2016-05-07T02:24:27Z","html_url":"https://github.com/apache/kafka/pull/1332#discussion_r62409933","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1332","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/62409933"},"html":{"href":"https://github.com/apache/kafka/pull/1332#discussion_r62409933"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1332"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1332","id":69167045,"html_url":"https://github.com/apache/kafka/pull/1332","diff_url":"https://github.com/apache/kafka/pull/1332.diff","patch_url":"https://github.com/apache/kafka/pull/1332.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1332","number":1332,"state":"open","locked":false,"title":"KAFKA-3587: LogCleaner fails due to incorrect offset map computation …","user":{"login":"mimaison","id":903615,"avatar_url":"https://avatars.githubusercontent.com/u/903615?v=3","gravatar_id":"","url":"https://api.github.com/users/mimaison","html_url":"https://github.com/mimaison","followers_url":"https://api.github.com/users/mimaison/followers","following_url":"https://api.github.com/users/mimaison/following{/other_user}","gists_url":"https://api.github.com/users/mimaison/gists{/gist_id}","starred_url":"https://api.github.com/users/mimaison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mimaison/subscriptions","organizations_url":"https://api.github.com/users/mimaison/orgs","repos_url":"https://api.github.com/users/mimaison/repos","events_url":"https://api.github.com/users/mimaison/events{/privacy}","received_events_url":"https://api.github.com/users/mimaison/received_events","type":"User","site_admin":false},"body":"Removed the over pessimistic require and instead attempt to fill the dedup buffer. Use the (only) map until full;\r\nthis may allow to process all dirty segment (optimism) or may happen in the middle of a dirt segment.\r\nIn either case, do compaction using the map loaded that way.\r\n\r\nThis patch was developed with @edoardocomar","created_at":"2016-05-06T15:25:13Z","updated_at":"2016-05-07T02:24:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"103b6527dc53daf1b5ad710932a56175504121ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1332/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1332/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1332/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/e4f4e5ed75a845f0c4cc2b6745dc213f71affe6d","head":{"label":"mimaison:KAFKA-3587","ref":"KAFKA-3587","sha":"e4f4e5ed75a845f0c4cc2b6745dc213f71affe6d","user":{"login":"mimaison","id":903615,"avatar_url":"https://avatars.githubusercontent.com/u/903615?v=3","gravatar_id":"","url":"https://api.github.com/users/mimaison","html_url":"https://github.com/mimaison","followers_url":"https://api.github.com/users/mimaison/followers","following_url":"https://api.github.com/users/mimaison/following{/other_user}","gists_url":"https://api.github.com/users/mimaison/gists{/gist_id}","starred_url":"https://api.github.com/users/mimaison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mimaison/subscriptions","organizations_url":"https://api.github.com/users/mimaison/orgs","repos_url":"https://api.github.com/users/mimaison/repos","events_url":"https://api.github.com/users/mimaison/events{/privacy}","received_events_url":"https://api.github.com/users/mimaison/received_events","type":"User","site_admin":false},"repo":{"id":53746208,"name":"kafka","full_name":"mimaison/kafka","owner":{"login":"mimaison","id":903615,"avatar_url":"https://avatars.githubusercontent.com/u/903615?v=3","gravatar_id":"","url":"https://api.github.com/users/mimaison","html_url":"https://github.com/mimaison","followers_url":"https://api.github.com/users/mimaison/followers","following_url":"https://api.github.com/users/mimaison/following{/other_user}","gists_url":"https://api.github.com/users/mimaison/gists{/gist_id}","starred_url":"https://api.github.com/users/mimaison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mimaison/subscriptions","organizations_url":"https://api.github.com/users/mimaison/orgs","repos_url":"https://api.github.com/users/mimaison/repos","events_url":"https://api.github.com/users/mimaison/events{/privacy}","received_events_url":"https://api.github.com/users/mimaison/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mimaison/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/mimaison/kafka","forks_url":"https://api.github.com/repos/mimaison/kafka/forks","keys_url":"https://api.github.com/repos/mimaison/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mimaison/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mimaison/kafka/teams","hooks_url":"https://api.github.com/repos/mimaison/kafka/hooks","issue_events_url":"https://api.github.com/repos/mimaison/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/mimaison/kafka/events","assignees_url":"https://api.github.com/repos/mimaison/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/mimaison/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/mimaison/kafka/tags","blobs_url":"https://api.github.com/repos/mimaison/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mimaison/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mimaison/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/mimaison/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mimaison/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/mimaison/kafka/languages","stargazers_url":"https://api.github.com/repos/mimaison/kafka/stargazers","contributors_url":"https://api.github.com/repos/mimaison/kafka/contributors","subscribers_url":"https://api.github.com/repos/mimaison/kafka/subscribers","subscription_url":"https://api.github.com/repos/mimaison/kafka/subscription","commits_url":"https://api.github.com/repos/mimaison/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/mimaison/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/mimaison/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/mimaison/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/mimaison/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/mimaison/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mimaison/kafka/merges","archive_url":"https://api.github.com/repos/mimaison/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mimaison/kafka/downloads","issues_url":"https://api.github.com/repos/mimaison/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/mimaison/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/mimaison/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/mimaison/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mimaison/kafka/labels{/name}","releases_url":"https://api.github.com/repos/mimaison/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/mimaison/kafka/deployments","created_at":"2016-03-12T18:15:26Z","updated_at":"2016-03-12T18:15:32Z","pushed_at":"2016-05-06T15:23:37Z","git_url":"git://github.com/mimaison/kafka.git","ssh_url":"git@github.com:mimaison/kafka.git","clone_url":"https://github.com/mimaison/kafka.git","svn_url":"https://github.com/mimaison/kafka","homepage":null,"size":30943,"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":"trunk"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"2ff955044aa875176aaa58a9be4a79c494a3fb27","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":2211243,"name":"kafka","full_name":"apache/kafka","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/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2016-05-07T02:15:31Z","pushed_at":"2016-05-07T01:42:52Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":41754,"stargazers_count":3061,"watchers_count":3061,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1840,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":174,"forks":1840,"open_issues":174,"watchers":3061,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1332"},"html":{"href":"https://github.com/apache/kafka/pull/1332"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1332"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1332/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1332/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1332/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/e4f4e5ed75a845f0c4cc2b6745dc213f71affe6d"}}}}