{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/40027367","id":40027367,"diff_hunk":"@@ -12,36 +12,81 @@\n \n package gobblin.data.management.retention;\n \n+import java.io.Closeable;\n import java.io.IOException;\n import java.lang.reflect.InvocationTargetException;\n import java.util.List;\n import java.util.Properties;\n+import java.util.concurrent.Callable;\n+import java.util.concurrent.CountDownLatch;\n+import java.util.concurrent.ExecutionException;\n+import java.util.concurrent.ExecutorService;\n+import java.util.concurrent.LinkedBlockingQueue;\n+import java.util.concurrent.ThreadPoolExecutor;\n+import java.util.concurrent.TimeUnit;\n \n+import com.codahale.metrics.Meter;\n+import com.google.common.base.Optional;\n import com.google.common.base.Preconditions;\n+import com.google.common.collect.Lists;\n+import com.google.common.io.Closer;\n+import com.google.common.util.concurrent.FutureCallback;\n+import com.google.common.util.concurrent.Futures;\n+import com.google.common.util.concurrent.ListenableFuture;\n+import com.google.common.util.concurrent.ListeningExecutorService;\n+import com.google.common.util.concurrent.MoreExecutors;\n \n import org.apache.hadoop.fs.FileSystem;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n \n+import gobblin.configuration.State;\n import gobblin.data.management.retention.dataset.Dataset;\n import gobblin.data.management.retention.dataset.finder.DatasetFinder;\n+import gobblin.instrumented.Instrumentable;\n+import gobblin.instrumented.Instrumented;\n+import gobblin.metrics.GobblinMetrics;\n+import gobblin.metrics.MetricContext;\n+import gobblin.metrics.Tag;\n+import gobblin.util.ExecutorsUtils;\n \n \n /**\n  * Finds existing versions of datasets and cleans old or deprecated versions.\n  */\n-public class DatasetCleaner {\n+public class DatasetCleaner implements Instrumentable, Closeable {\n \n   public static final String CONFIGURATION_KEY_PREFIX = \"gobblin.retention.\";\n   public static final String DATASET_PROFILE_CLASS_KEY = CONFIGURATION_KEY_PREFIX + \"dataset.profile.class\";\n+  public static final String DATASET_CLEAN_MAX_CONCURRENT_HDFS_CALLS = CONFIGURATION_KEY_PREFIX\n+      + \"dataset.clean.max.concurrent.hdfs.calls\";\n+  public static final String DATASET_CLEAN_HDFS_CALLS_PER_SECOND_LIMIT = CONFIGURATION_KEY_PREFIX + \"hdfs.calls.per.second.limit\";\n+\n+  public static final String DEFAULT_DATASET_CLEAN_MAX_CONCURRENT_HDFS_CALLS = \"1000\";\n+  public static final String DEFAULT_DATASET_CLEAN_HDFS_CALLS_PER_SECOND_LIMIT = \"10\";","path":"gobblin-data-management/src/main/java/gobblin/data/management/retention/DatasetCleaner.java","position":56,"original_position":56,"commit_id":"ed71d974c0eff64419d963ea354cc680a976f5dd","original_commit_id":"ed71d974c0eff64419d963ea354cc680a976f5dd","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":"This default seems low. I would rather make it infinite, or at least very large (most users will not change this, and it would suck if the cleaner is slow by default).","created_at":"2015-09-21T21:18:45Z","updated_at":"2015-09-21T21:18:45Z","html_url":"https://github.com/linkedin/gobblin/pull/331#discussion_r40027367","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/331","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/40027367"},"html":{"href":"https://github.com/linkedin/gobblin/pull/331#discussion_r40027367"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/331"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/331","id":45117913,"html_url":"https://github.com/linkedin/gobblin/pull/331","diff_url":"https://github.com/linkedin/gobblin/pull/331.diff","patch_url":"https://github.com/linkedin/gobblin/pull/331.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/331","number":331,"state":"open","locked":false,"title":"Parallelize Dataset cleaner","user":{"login":"ydailinkedin","id":10764942,"avatar_url":"https://avatars.githubusercontent.com/u/10764942?v=3","gravatar_id":"","url":"https://api.github.com/users/ydailinkedin","html_url":"https://github.com/ydailinkedin","followers_url":"https://api.github.com/users/ydailinkedin/followers","following_url":"https://api.github.com/users/ydailinkedin/following{/other_user}","gists_url":"https://api.github.com/users/ydailinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/ydailinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ydailinkedin/subscriptions","organizations_url":"https://api.github.com/users/ydailinkedin/orgs","repos_url":"https://api.github.com/users/ydailinkedin/repos","events_url":"https://api.github.com/users/ydailinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/ydailinkedin/received_events","type":"User","site_admin":false},"body":"@ibuenros Can you review?","created_at":"2015-09-16T00:12:23Z","updated_at":"2015-09-21T21:18:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"393aff6e25267771e38926a95140900e679544df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/331/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/331/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/331/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/ed71d974c0eff64419d963ea354cc680a976f5dd","head":{"label":"ydailinkedin:master","ref":"master","sha":"ed71d974c0eff64419d963ea354cc680a976f5dd","user":{"login":"ydailinkedin","id":10764942,"avatar_url":"https://avatars.githubusercontent.com/u/10764942?v=3","gravatar_id":"","url":"https://api.github.com/users/ydailinkedin","html_url":"https://github.com/ydailinkedin","followers_url":"https://api.github.com/users/ydailinkedin/followers","following_url":"https://api.github.com/users/ydailinkedin/following{/other_user}","gists_url":"https://api.github.com/users/ydailinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/ydailinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ydailinkedin/subscriptions","organizations_url":"https://api.github.com/users/ydailinkedin/orgs","repos_url":"https://api.github.com/users/ydailinkedin/repos","events_url":"https://api.github.com/users/ydailinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/ydailinkedin/received_events","type":"User","site_admin":false},"repo":{"id":31681854,"name":"gobblin-1","full_name":"ydailinkedin/gobblin-1","owner":{"login":"ydailinkedin","id":10764942,"avatar_url":"https://avatars.githubusercontent.com/u/10764942?v=3","gravatar_id":"","url":"https://api.github.com/users/ydailinkedin","html_url":"https://github.com/ydailinkedin","followers_url":"https://api.github.com/users/ydailinkedin/followers","following_url":"https://api.github.com/users/ydailinkedin/following{/other_user}","gists_url":"https://api.github.com/users/ydailinkedin/gists{/gist_id}","starred_url":"https://api.github.com/users/ydailinkedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ydailinkedin/subscriptions","organizations_url":"https://api.github.com/users/ydailinkedin/orgs","repos_url":"https://api.github.com/users/ydailinkedin/repos","events_url":"https://api.github.com/users/ydailinkedin/events{/privacy}","received_events_url":"https://api.github.com/users/ydailinkedin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ydailinkedin/gobblin-1","description":"","fork":true,"url":"https://api.github.com/repos/ydailinkedin/gobblin-1","forks_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/forks","keys_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/teams","hooks_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/hooks","issue_events_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/issues/events{/number}","events_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/events","assignees_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/assignees{/user}","branches_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/branches{/branch}","tags_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/tags","blobs_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/statuses/{sha}","languages_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/languages","stargazers_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/stargazers","contributors_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/contributors","subscribers_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/subscribers","subscription_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/subscription","commits_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/contents/{+path}","compare_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/merges","archive_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/downloads","issues_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/issues{/number}","pulls_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/pulls{/number}","milestones_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/milestones{/number}","notifications_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/labels{/name}","releases_url":"https://api.github.com/repos/ydailinkedin/gobblin-1/releases{/id}","created_at":"2015-03-04T21:53:04Z","updated_at":"2015-04-03T16:44:08Z","pushed_at":"2015-09-21T20:45:12Z","git_url":"git://github.com/ydailinkedin/gobblin-1.git","ssh_url":"git@github.com:ydailinkedin/gobblin-1.git","clone_url":"https://github.com/ydailinkedin/gobblin-1.git","svn_url":"https://github.com/ydailinkedin/gobblin-1","homepage":null,"size":78842,"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":"9c5afa3c6668be4c143fdb8432f77f1e47eaedad","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}","created_at":"2014-12-01T18:10:50Z","updated_at":"2015-09-21T06:33:22Z","pushed_at":"2015-09-21T20:45:14Z","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":"","size":159574,"stargazers_count":181,"watchers_count":181,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":8,"forks":66,"open_issues":8,"watchers":181,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/331"},"html":{"href":"https://github.com/linkedin/gobblin/pull/331"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/331"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/331/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/331/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/331/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/ed71d974c0eff64419d963ea354cc680a976f5dd"}}}}