{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/80582174","id":80582174,"diff_hunk":"@@ -0,0 +1,109 @@\n+/*\n+ * Copyright (C) 2014-2016 LinkedIn Corp. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n+ * this file except in compliance with the License. You may obtain a copy of the\n+ * License at  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed\n+ * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied.\n+ */\n+package gobblin.data.management.retention.action;\n+\n+import java.io.IOException;\n+import java.util.List;\n+\n+import org.apache.hadoop.fs.FileSystem;\n+\n+import com.google.common.base.Preconditions;\n+import com.google.common.collect.Lists;\n+import com.typesafe.config.Config;\n+import com.typesafe.config.ConfigRenderOptions;\n+\n+import gobblin.data.management.retention.dataset.ConfigurableCleanableDataset;\n+import gobblin.data.management.version.DatasetVersion;\n+import gobblin.util.ConfigUtils;\n+\n+\n+/**\n+ * A wrapped around {@link AccessControlAction} that delegates the {@link #execute(List)} call to multiple embedded\n+ * {@link AccessControlAction}s\n+ * Use {@link MultiAccessControlActionFactory} to create new {@link MultiAccessControlAction}s\n+ */\n+public class MultiAccessControlAction extends RetentionAction {","path":"gobblin-data-management/src/main/java/gobblin/data/management/retention/action/MultiAccessControlAction.java","position":null,"original_position":34,"commit_id":"d33ae0890cce05a7a009d2c49c2b00311866f469","original_commit_id":"9e09bb6629adc28720e3c506e18607c7ae55e208","user":{"login":"ibuenros","id":1364112,"avatar_url":"https://avatars.githubusercontent.com/u/1364112?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuenros","html_url":"https://github.com/ibuenros","followers_url":"https://api.github.com/users/ibuenros/followers","following_url":"https://api.github.com/users/ibuenros/following{/other_user}","gists_url":"https://api.github.com/users/ibuenros/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuenros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuenros/subscriptions","organizations_url":"https://api.github.com/users/ibuenros/orgs","repos_url":"https://api.github.com/users/ibuenros/repos","events_url":"https://api.github.com/users/ibuenros/events{/privacy}","received_events_url":"https://api.github.com/users/ibuenros/received_events","type":"User","site_admin":false},"body":"But why not call `execute` on each action independently instead of using a `MultiAccessControlAction`?","created_at":"2016-09-26T21:53:21Z","updated_at":"2016-09-26T21:53:21Z","html_url":"https://github.com/linkedin/gobblin/pull/1279#discussion_r80582174","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1279","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/80582174"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1279#discussion_r80582174"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1279"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/1279","id":86268978,"html_url":"https://github.com/linkedin/gobblin/pull/1279","diff_url":"https://github.com/linkedin/gobblin/pull/1279.diff","patch_url":"https://github.com/linkedin/gobblin/pull/1279.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/1279","number":1279,"state":"open","locked":false,"title":"Add Access control retention action","user":{"login":"pcadabam","id":1166372,"avatar_url":"https://avatars.githubusercontent.com/u/1166372?v=3","gravatar_id":"","url":"https://api.github.com/users/pcadabam","html_url":"https://github.com/pcadabam","followers_url":"https://api.github.com/users/pcadabam/followers","following_url":"https://api.github.com/users/pcadabam/following{/other_user}","gists_url":"https://api.github.com/users/pcadabam/gists{/gist_id}","starred_url":"https://api.github.com/users/pcadabam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcadabam/subscriptions","organizations_url":"https://api.github.com/users/pcadabam/orgs","repos_url":"https://api.github.com/users/pcadabam/repos","events_url":"https://api.github.com/users/pcadabam/events{/privacy}","received_events_url":"https://api.github.com/users/pcadabam/received_events","type":"User","site_admin":false},"body":"## Changes\r\n\r\n- Extend gobblin retention to plug-in `RetentionAction`s\r\n- Implement `AccessControlAction` to set permission/user/group for versions\r\n- Implement `SelectBetweenTimeBasedSelectionPolicy` to select versions created/modified in a time range\r\n- Added unit and integration tests\r\n\r\nDesign doc - https://docs.google.com/document/d/17k8kbxh-OXe6_HVLn51ke4sdRtVx4zP0Jrni1nrfTFg/edit#\r\n\r\nConfig for Access control action\r\n\r\n<pre>\r\ngobblin.retention {\r\n\t\taccessControl {\r\n\t        policies = [restricted,noAccess]\r\n\t        restricted {\r\n\t             selection {\r\n\t                policy.class=SelectionBetweenTimeBasedSelectionPolicy\r\n\t                timeBased.maxLookbackTime=3y\r\n\t                timeBased.minLookbackTime=2y\r\n\t             }\r\n\t             mode : 770\r\n\t              user : u1\r\n\t              group : g1\r\n\t          }\r\n\t         noAccess {\r\n\t             selection {\r\n\t                policy.class=SelectionBetweenTimeBasedSelectionPolicy\r\n\t                timeBased.maxLookbackTime=5y\r\n\t                timeBased.minLookbackTime=3y\r\n\t             }\r\n\t             mode : 700\r\n\t             user : u2\r\n\t             group : g2\r\n\t          }\r\n\t     }\r\n}\r\n</pre>\r\n\r\nMain classes to review \r\n\r\n1. `RetentionAction` the new API for retention actions like access control, encryption, deletion etc.\r\n2. `RetentionAction.RetentionActionFactory` the factory API for creating new retention actions. The factory has a `RetentionAction.RetentionActionFactory#canCreateWithConfig(config)` method which decides if the `config` object passed has all the required keys to create a new `RetentionAction`. If yes, `RetentionAction.RetentionActionFactory#createRetentionAction(config)` is called. This pattern allows adding new `RetentionAction`s easily. A `RetentionAction` can decide to use whatever config keys it wants which only its facory knows.\r\n3. `AccessControlAction` mostly business logic for setting permissions, user and group\r\n\r\n@ibuenros and @chavdar can you review?\r\n","created_at":"2016-09-22T01:46:46Z","updated_at":"2016-09-26T21:53:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edaacbd4d1cf9d852287e9d319b7b4c8fc74f91d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1279/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/1279/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/1279/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/d33ae0890cce05a7a009d2c49c2b00311866f469","head":{"label":"pcadabam:retention","ref":"retention","sha":"d33ae0890cce05a7a009d2c49c2b00311866f469","user":{"login":"pcadabam","id":1166372,"avatar_url":"https://avatars.githubusercontent.com/u/1166372?v=3","gravatar_id":"","url":"https://api.github.com/users/pcadabam","html_url":"https://github.com/pcadabam","followers_url":"https://api.github.com/users/pcadabam/followers","following_url":"https://api.github.com/users/pcadabam/following{/other_user}","gists_url":"https://api.github.com/users/pcadabam/gists{/gist_id}","starred_url":"https://api.github.com/users/pcadabam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcadabam/subscriptions","organizations_url":"https://api.github.com/users/pcadabam/orgs","repos_url":"https://api.github.com/users/pcadabam/repos","events_url":"https://api.github.com/users/pcadabam/events{/privacy}","received_events_url":"https://api.github.com/users/pcadabam/received_events","type":"User","site_admin":false},"repo":{"id":36956709,"name":"gobblin","full_name":"pcadabam/gobblin","owner":{"login":"pcadabam","id":1166372,"avatar_url":"https://avatars.githubusercontent.com/u/1166372?v=3","gravatar_id":"","url":"https://api.github.com/users/pcadabam","html_url":"https://github.com/pcadabam","followers_url":"https://api.github.com/users/pcadabam/followers","following_url":"https://api.github.com/users/pcadabam/following{/other_user}","gists_url":"https://api.github.com/users/pcadabam/gists{/gist_id}","starred_url":"https://api.github.com/users/pcadabam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcadabam/subscriptions","organizations_url":"https://api.github.com/users/pcadabam/orgs","repos_url":"https://api.github.com/users/pcadabam/repos","events_url":"https://api.github.com/users/pcadabam/events{/privacy}","received_events_url":"https://api.github.com/users/pcadabam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pcadabam/gobblin","description":"","fork":true,"url":"https://api.github.com/repos/pcadabam/gobblin","forks_url":"https://api.github.com/repos/pcadabam/gobblin/forks","keys_url":"https://api.github.com/repos/pcadabam/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pcadabam/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pcadabam/gobblin/teams","hooks_url":"https://api.github.com/repos/pcadabam/gobblin/hooks","issue_events_url":"https://api.github.com/repos/pcadabam/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/pcadabam/gobblin/events","assignees_url":"https://api.github.com/repos/pcadabam/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/pcadabam/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/pcadabam/gobblin/tags","blobs_url":"https://api.github.com/repos/pcadabam/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pcadabam/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pcadabam/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/pcadabam/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pcadabam/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/pcadabam/gobblin/languages","stargazers_url":"https://api.github.com/repos/pcadabam/gobblin/stargazers","contributors_url":"https://api.github.com/repos/pcadabam/gobblin/contributors","subscribers_url":"https://api.github.com/repos/pcadabam/gobblin/subscribers","subscription_url":"https://api.github.com/repos/pcadabam/gobblin/subscription","commits_url":"https://api.github.com/repos/pcadabam/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/pcadabam/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/pcadabam/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/pcadabam/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/pcadabam/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/pcadabam/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pcadabam/gobblin/merges","archive_url":"https://api.github.com/repos/pcadabam/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pcadabam/gobblin/downloads","issues_url":"https://api.github.com/repos/pcadabam/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/pcadabam/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/pcadabam/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/pcadabam/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pcadabam/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/pcadabam/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/pcadabam/gobblin/deployments","created_at":"2015-06-05T21:39:40Z","updated_at":"2016-01-28T20:06:08Z","pushed_at":"2016-09-26T21:14:08Z","git_url":"git://github.com/pcadabam/gobblin.git","ssh_url":"git@github.com:pcadabam/gobblin.git","clone_url":"https://github.com/pcadabam/gobblin.git","svn_url":"https://github.com/pcadabam/gobblin","homepage":null,"size":90665,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"linkedin:master","ref":"master","sha":"8cc200a7df4c0c862d1654c8dc2524d745aec686","user":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"repo":{"id":27392543,"name":"gobblin","full_name":"linkedin/gobblin","owner":{"login":"linkedin","id":357098,"avatar_url":"https://avatars.githubusercontent.com/u/357098?v=3","gravatar_id":"","url":"https://api.github.com/users/linkedin","html_url":"https://github.com/linkedin","followers_url":"https://api.github.com/users/linkedin/followers","following_url":"https://api.github.com/users/linkedin/following{/other_user}","gists_url":"https://api.github.com/users/linkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/linkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linkedin/subscriptions","organizations_url":"https://api.github.com/users/linkedin/orgs","repos_url":"https://api.github.com/users/linkedin/repos","events_url":"https://api.github.com/users/linkedin/events{/privacy}","received_events_url":"https://api.github.com/users/linkedin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linkedin/gobblin","description":"Universal data ingestion framework for Hadoop.","fork":false,"url":"https://api.github.com/repos/linkedin/gobblin","forks_url":"https://api.github.com/repos/linkedin/gobblin/forks","keys_url":"https://api.github.com/repos/linkedin/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linkedin/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linkedin/gobblin/teams","hooks_url":"https://api.github.com/repos/linkedin/gobblin/hooks","issue_events_url":"https://api.github.com/repos/linkedin/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/linkedin/gobblin/events","assignees_url":"https://api.github.com/repos/linkedin/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/linkedin/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/linkedin/gobblin/tags","blobs_url":"https://api.github.com/repos/linkedin/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linkedin/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linkedin/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/linkedin/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/linkedin/gobblin/languages","stargazers_url":"https://api.github.com/repos/linkedin/gobblin/stargazers","contributors_url":"https://api.github.com/repos/linkedin/gobblin/contributors","subscribers_url":"https://api.github.com/repos/linkedin/gobblin/subscribers","subscription_url":"https://api.github.com/repos/linkedin/gobblin/subscription","commits_url":"https://api.github.com/repos/linkedin/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/linkedin/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/linkedin/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/linkedin/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/linkedin/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/linkedin/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linkedin/gobblin/merges","archive_url":"https://api.github.com/repos/linkedin/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linkedin/gobblin/downloads","issues_url":"https://api.github.com/repos/linkedin/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/linkedin/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/linkedin/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/linkedin/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linkedin/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/linkedin/gobblin/releases{/id}","deployments_url":"https://api.github.com/repos/linkedin/gobblin/deployments","created_at":"2014-12-01T18:10:50Z","updated_at":"2016-09-26T12:50:35Z","pushed_at":"2016-09-26T21:14:09Z","git_url":"git://github.com/linkedin/gobblin.git","ssh_url":"git@github.com:linkedin/gobblin.git","clone_url":"https://github.com/linkedin/gobblin.git","svn_url":"https://github.com/linkedin/gobblin","homepage":"https://github.com/linkedin/gobblin/wiki","size":181244,"stargazers_count":724,"watchers_count":724,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":285,"mirror_url":null,"open_issues_count":122,"forks":285,"open_issues":122,"watchers":724,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1279"},"html":{"href":"https://github.com/linkedin/gobblin/pull/1279"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1279"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/1279/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1279/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/1279/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/d33ae0890cce05a7a009d2c49c2b00311866f469"}}}}
{"actor":{"display_login":"ibuenros"}}