{"action":"created","comment":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/comments/93311815","pull_request_review_id":13836968,"id":93311815,"diff_hunk":"@@ -0,0 +1,65 @@\n+%% Copyright (c) 2011-2015 Basho Technologies, Inc.  All Rights Reserved.\n+%%\n+%% This file is provided to you under the Apache License,\n+%% Version 2.0 (the \"License\"); you may not use this file\n+%% except in compliance with the License.  You may obtain\n+%% 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+%% Used as configuration for sweep participants.\n+-record(sweep_participant,","path":"include/riak_kv_sweeper.hrl","position":18,"original_position":18,"commit_id":"83246a8c80a325bfd9761278025a0ce98e454593","original_commit_id":"1f4eaf7d814ecc72778a34d03dc2ec2dcda0eba8","user":{"login":"lehoff","id":193034,"avatar_url":"https://avatars.githubusercontent.com/u/193034?v=3","gravatar_id":"","url":"https://api.github.com/users/lehoff","html_url":"https://github.com/lehoff","followers_url":"https://api.github.com/users/lehoff/followers","following_url":"https://api.github.com/users/lehoff/following{/other_user}","gists_url":"https://api.github.com/users/lehoff/gists{/gist_id}","starred_url":"https://api.github.com/users/lehoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehoff/subscriptions","organizations_url":"https://api.github.com/users/lehoff/orgs","repos_url":"https://api.github.com/users/lehoff/repos","events_url":"https://api.github.com/users/lehoff/events{/privacy}","received_events_url":"https://api.github.com/users/lehoff/received_events","type":"User","site_admin":false},"body":"Revisiting its usage today... it should not be in its own module. It belongs in `riak_kv_sweeper_fold`. \r\n\r\nOutside `riak_kv_sweeper_fold` the usage is very limited and can be fixed with a few setters/getters - tests have not been considered.\r\n```\r\nsrc/riak_kv_delete_sup.erl\r\n70:      #sweep_participant{ description = \"Object TTL\",\r\n89:      #sweep_participant{ description = \"Reap tombstones\",\r\n\r\nsrc/riak_kv_entropy_manager.erl\r\n244:      #sweep_participant{\r\n\r\nsrc/riak_kv_sweeper.erl\r\n25:%% schedules sweeps.  Anyone can register a #sweep_participant{} with\r\n34:%% #sweep_participant{}.\r\n123:-spec add_sweep_participant(#sweep_participant{}) -> ok.\r\n139:-spec status() -> {[#sweep_participant{}], [#sweep{}]}.\r\n161:                           [#sweep_participant{}],\r\n\r\nsrc/riak_kv_sweeper_cli.erl\r\n136:     || {Index, #sweep_participant{module = Mod}} <- IndexedParticipants].\r\n162:format_sweep_participant(Index, #sweep_participant{module = Mod,\r\n\r\nsrc/riak_kv_sweeper_state.erl\r\n100:                            Participant:: #sweep_participant{}) -> state().\r\n135:                          {Participants :: [#sweep_participant{}],\r\n153:    {'ok', Participants :: [#sweep_participant{}], state()}.\r\n162:        [Participant#sweep_participant{sweep_fun = Fun, acc = InitialAcc} ||\r\n189:                           [#sweep_participant{}],\r\n344:     {Module, #sweep_participant{run_interval = RunInterval}}\r\n525:        {ok, #sweep_participant{run_interval = RunInterval}} ->\r\n676:    #sweep_participant{module = Module,\r\n744:    #sweep_participant{\r\n```\r\n\r\n`riak_kv_delete_sup`: a `riak_kv_sweeper_fold:new_participant/5` function to create the record.\r\n\r\n`riak_kv_entropy_manager`: use the function above.\r\n \r\n`riak_kv_sweeper`: use the `riak_kv_sweeper_fold:participant()` type instead of the record in the type declarations.\r\n\r\n`riak_kv_sweeper_cli`:  move the formatting to `riak_kv_sweeper_fold`.\r\n\r\n`riak_kv_sweeper_state`: \r\n* Add a function to get the module out. Not sure what the name should be, maybe `participant_module/1`?\r\n* Add a function to set the fun and initial accumulator. Say, `set_sweep_parameters/3`.\r\n* Add a function to set the run interval.\r\n\r\nThis is doable. It will make the testing in `riak_kv_sweeper_state` a bit harder, but maybe the generators for the `#sweep_participant{}` should be defined alongside the record definition?\r\n","created_at":"2016-12-20T19:51:40Z","updated_at":"2016-12-20T19:51:40Z","html_url":"https://github.com/basho/riak_kv/pull/1562#discussion_r93311815","pull_request_url":"https://api.github.com/repos/basho/riak_kv/pulls/1562","_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments/93311815"},"html":{"href":"https://github.com/basho/riak_kv/pull/1562#discussion_r93311815"},"pull_request":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1562"}}},"pull_request":{"url":"https://api.github.com/repos/basho/riak_kv/pulls/1562","id":96807526,"html_url":"https://github.com/basho/riak_kv/pull/1562","diff_url":"https://github.com/basho/riak_kv/pull/1562.diff","patch_url":"https://github.com/basho/riak_kv/pull/1562.patch","issue_url":"https://api.github.com/repos/basho/riak_kv/issues/1562","number":1562,"state":"open","locked":false,"title":"Merge riak_kv sweeper code to develop","user":{"login":"nickelization","id":4108538,"avatar_url":"https://avatars.githubusercontent.com/u/4108538?v=3","gravatar_id":"","url":"https://api.github.com/users/nickelization","html_url":"https://github.com/nickelization","followers_url":"https://api.github.com/users/nickelization/followers","following_url":"https://api.github.com/users/nickelization/following{/other_user}","gists_url":"https://api.github.com/users/nickelization/gists{/gist_id}","starred_url":"https://api.github.com/users/nickelization/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickelization/subscriptions","organizations_url":"https://api.github.com/users/nickelization/orgs","repos_url":"https://api.github.com/users/nickelization/repos","events_url":"https://api.github.com/users/nickelization/events{/privacy}","received_events_url":"https://api.github.com/users/nickelization/received_events","type":"User","site_admin":false},"body":"There are still some things left to do before we release this code, but it's solid enough to merge it to develop.\r\n\r\nThe original sweeper code was written by a contractor, Mikael Lixenstrand. His development work still exist in various repos under branches name 'object_ttl'. This builds off of his work, adding lots of additional test coverage, fixing a bunch of bugs, and generally improving the quality of the code.\r\n\r\nThis PR depends on three other pull requests being merged first:\r\n\r\n- [ ] https://github.com/basho/riak_repl/pull/765\r\n- [ ] https://github.com/basho/riak_pb/pull/216\r\n- [ ] https://github.com/basho/riak_core/pull/882","created_at":"2016-12-06T21:19:15Z","updated_at":"2016-12-20T19:51:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f658caa3fb199b16498ac4529e092c7a25948ca","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/basho/riak_kv/pulls/1562/commits","review_comments_url":"https://api.github.com/repos/basho/riak_kv/pulls/1562/comments","review_comment_url":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/basho/riak_kv/issues/1562/comments","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/83246a8c80a325bfd9761278025a0ce98e454593","head":{"label":"basho:sweeper-2.3-integration","ref":"sweeper-2.3-integration","sha":"83246a8c80a325bfd9761278025a0ce98e454593","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":791522,"name":"riak_kv","full_name":"basho/riak_kv","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_kv","description":"Riak Key/Value Store","fork":false,"url":"https://api.github.com/repos/basho/riak_kv","forks_url":"https://api.github.com/repos/basho/riak_kv/forks","keys_url":"https://api.github.com/repos/basho/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_kv/teams","hooks_url":"https://api.github.com/repos/basho/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_kv/events","assignees_url":"https://api.github.com/repos/basho/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_kv/tags","blobs_url":"https://api.github.com/repos/basho/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_kv/languages","stargazers_url":"https://api.github.com/repos/basho/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_kv/subscription","commits_url":"https://api.github.com/repos/basho/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_kv/merges","archive_url":"https://api.github.com/repos/basho/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_kv/downloads","issues_url":"https://api.github.com/repos/basho/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_kv/releases{/id}","deployments_url":"https://api.github.com/repos/basho/riak_kv/deployments","created_at":"2010-07-22T17:27:35Z","updated_at":"2016-12-10T12:39:12Z","pushed_at":"2016-12-20T16:23:46Z","git_url":"git://github.com/basho/riak_kv.git","ssh_url":"git@github.com:basho/riak_kv.git","clone_url":"https://github.com/basho/riak_kv.git","svn_url":"https://github.com/basho/riak_kv","homepage":"","size":13031,"stargazers_count":351,"watchers_count":351,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":139,"mirror_url":null,"open_issues_count":180,"forks":139,"open_issues":180,"watchers":351,"default_branch":"develop"}},"base":{"label":"basho:develop","ref":"develop","sha":"9f0ddacee9e518f430477639aa1f5bc3f6e6890f","user":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"repo":{"id":791522,"name":"riak_kv","full_name":"basho/riak_kv","owner":{"login":"basho","id":176293,"avatar_url":"https://avatars.githubusercontent.com/u/176293?v=3","gravatar_id":"","url":"https://api.github.com/users/basho","html_url":"https://github.com/basho","followers_url":"https://api.github.com/users/basho/followers","following_url":"https://api.github.com/users/basho/following{/other_user}","gists_url":"https://api.github.com/users/basho/gists{/gist_id}","starred_url":"https://api.github.com/users/basho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basho/subscriptions","organizations_url":"https://api.github.com/users/basho/orgs","repos_url":"https://api.github.com/users/basho/repos","events_url":"https://api.github.com/users/basho/events{/privacy}","received_events_url":"https://api.github.com/users/basho/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/basho/riak_kv","description":"Riak Key/Value Store","fork":false,"url":"https://api.github.com/repos/basho/riak_kv","forks_url":"https://api.github.com/repos/basho/riak_kv/forks","keys_url":"https://api.github.com/repos/basho/riak_kv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basho/riak_kv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basho/riak_kv/teams","hooks_url":"https://api.github.com/repos/basho/riak_kv/hooks","issue_events_url":"https://api.github.com/repos/basho/riak_kv/issues/events{/number}","events_url":"https://api.github.com/repos/basho/riak_kv/events","assignees_url":"https://api.github.com/repos/basho/riak_kv/assignees{/user}","branches_url":"https://api.github.com/repos/basho/riak_kv/branches{/branch}","tags_url":"https://api.github.com/repos/basho/riak_kv/tags","blobs_url":"https://api.github.com/repos/basho/riak_kv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basho/riak_kv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basho/riak_kv/git/refs{/sha}","trees_url":"https://api.github.com/repos/basho/riak_kv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basho/riak_kv/statuses/{sha}","languages_url":"https://api.github.com/repos/basho/riak_kv/languages","stargazers_url":"https://api.github.com/repos/basho/riak_kv/stargazers","contributors_url":"https://api.github.com/repos/basho/riak_kv/contributors","subscribers_url":"https://api.github.com/repos/basho/riak_kv/subscribers","subscription_url":"https://api.github.com/repos/basho/riak_kv/subscription","commits_url":"https://api.github.com/repos/basho/riak_kv/commits{/sha}","git_commits_url":"https://api.github.com/repos/basho/riak_kv/git/commits{/sha}","comments_url":"https://api.github.com/repos/basho/riak_kv/comments{/number}","issue_comment_url":"https://api.github.com/repos/basho/riak_kv/issues/comments{/number}","contents_url":"https://api.github.com/repos/basho/riak_kv/contents/{+path}","compare_url":"https://api.github.com/repos/basho/riak_kv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basho/riak_kv/merges","archive_url":"https://api.github.com/repos/basho/riak_kv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basho/riak_kv/downloads","issues_url":"https://api.github.com/repos/basho/riak_kv/issues{/number}","pulls_url":"https://api.github.com/repos/basho/riak_kv/pulls{/number}","milestones_url":"https://api.github.com/repos/basho/riak_kv/milestones{/number}","notifications_url":"https://api.github.com/repos/basho/riak_kv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basho/riak_kv/labels{/name}","releases_url":"https://api.github.com/repos/basho/riak_kv/releases{/id}","deployments_url":"https://api.github.com/repos/basho/riak_kv/deployments","created_at":"2010-07-22T17:27:35Z","updated_at":"2016-12-10T12:39:12Z","pushed_at":"2016-12-20T16:23:46Z","git_url":"git://github.com/basho/riak_kv.git","ssh_url":"git@github.com:basho/riak_kv.git","clone_url":"https://github.com/basho/riak_kv.git","svn_url":"https://github.com/basho/riak_kv","homepage":"","size":13031,"stargazers_count":351,"watchers_count":351,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":139,"mirror_url":null,"open_issues_count":180,"forks":139,"open_issues":180,"watchers":351,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1562"},"html":{"href":"https://github.com/basho/riak_kv/pull/1562"},"issue":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1562"},"comments":{"href":"https://api.github.com/repos/basho/riak_kv/issues/1562/comments"},"review_comments":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1562/comments"},"review_comment":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/basho/riak_kv/pulls/1562/commits"},"statuses":{"href":"https://api.github.com/repos/basho/riak_kv/statuses/83246a8c80a325bfd9761278025a0ce98e454593"}}}}
{"actor":{"display_login":"lehoff"}}