{"action":"created","comment":{"url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments/27021616","id":27021616,"diff_hunk":"@@ -0,0 +1,102 @@\n+package org.atlasapi.system.bootstrap;\n+\n+import com.google.api.client.util.Sets;\n+import com.google.common.collect.Iterables;\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.metabroadcast.common.scheduling.UpdateProgress;\n+import org.atlasapi.media.channel.Channel;\n+import org.atlasapi.media.entity.Publisher;\n+import org.joda.time.Interval;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.util.Set;\n+import java.util.concurrent.atomic.AtomicBoolean;\n+import java.util.concurrent.atomic.AtomicInteger;\n+import java.util.concurrent.atomic.AtomicReference;\n+import java.util.concurrent.locks.ReentrantLock;\n+\n+public class ScheduleBootstrapper {\n+\n+    private static final Logger log = LoggerFactory.getLogger(ScheduleBootstrapper.class);\n+    private final ReentrantLock bootstrapLock = new ReentrantLock();\n+    private final AtomicBoolean bootstrapping = new AtomicBoolean(false);\n+    private final AtomicInteger processed = new AtomicInteger(0);\n+    private final AtomicInteger failures = new AtomicInteger(0);\n+    private final AtomicReference<Throwable> lastException = new AtomicReference<>();\n+    private final ListeningExecutorService executor;\n+    private final ChannelIntervalScheduleBootstrapTaskFactory taskFactory;\n+\n+    public ScheduleBootstrapper(\n+            ListeningExecutorService executor,\n+            ChannelIntervalScheduleBootstrapTaskFactory taskFactory\n+    ) {\n+        this.executor = executor;","path":"atlas-processing/src/main/java/org/atlasapi/system/bootstrap/ScheduleBootstrapper.java","position":37,"original_position":37,"commit_id":"e1f581ebdf7f6d450be1ca4cf70e7f437a6f19cb","original_commit_id":"e1f581ebdf7f6d450be1ca4cf70e7f437a6f19cb","user":{"login":"tfm","id":747291,"avatar_url":"https://avatars.githubusercontent.com/u/747291?v=3","gravatar_id":"","url":"https://api.github.com/users/tfm","html_url":"https://github.com/tfm","followers_url":"https://api.github.com/users/tfm/followers","following_url":"https://api.github.com/users/tfm/following{/other_user}","gists_url":"https://api.github.com/users/tfm/gists{/gist_id}","starred_url":"https://api.github.com/users/tfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfm/subscriptions","organizations_url":"https://api.github.com/users/tfm/orgs","repos_url":"https://api.github.com/users/tfm/repos","events_url":"https://api.github.com/users/tfm/events{/privacy}","received_events_url":"https://api.github.com/users/tfm/received_events","type":"User","site_admin":false},"body":"`checkNotNull`","created_at":"2015-03-24T12:13:50Z","updated_at":"2015-03-24T12:13:50Z","html_url":"https://github.com/atlasapi/atlas-deer/pull/74#discussion_r27021616","pull_request_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74","_links":{"self":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments/27021616"},"html":{"href":"https://github.com/atlasapi/atlas-deer/pull/74#discussion_r27021616"},"pull_request":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74"}}},"pull_request":{"url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74","id":31744508,"html_url":"https://github.com/atlasapi/atlas-deer/pull/74","diff_url":"https://github.com/atlasapi/atlas-deer/pull/74.diff","patch_url":"https://github.com/atlasapi/atlas-deer/pull/74.patch","issue_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/74","number":74,"state":"open","locked":false,"title":"Add enpoint to bootstrap all channels and check status.","user":{"login":"wwajerowicz","id":1240210,"avatar_url":"https://avatars.githubusercontent.com/u/1240210?v=3","gravatar_id":"","url":"https://api.github.com/users/wwajerowicz","html_url":"https://github.com/wwajerowicz","followers_url":"https://api.github.com/users/wwajerowicz/followers","following_url":"https://api.github.com/users/wwajerowicz/following{/other_user}","gists_url":"https://api.github.com/users/wwajerowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/wwajerowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wwajerowicz/subscriptions","organizations_url":"https://api.github.com/users/wwajerowicz/orgs","repos_url":"https://api.github.com/users/wwajerowicz/repos","events_url":"https://api.github.com/users/wwajerowicz/events{/privacy}","received_events_url":"https://api.github.com/users/wwajerowicz/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-23T15:46:13Z","updated_at":"2015-03-24T12:13:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee61311f9131affca86e8e7eff599e8a6c590dc6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74/commits","review_comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74/comments","review_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/74/comments","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/e1f581ebdf7f6d450be1ca4cf70e7f437a6f19cb","head":{"label":"atlasapi:bootstrap-all-the-channels","ref":"bootstrap-all-the-channels","sha":"e1f581ebdf7f6d450be1ca4cf70e7f437a6f19cb","user":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"repo":{"id":14117583,"name":"atlas-deer","full_name":"atlasapi/atlas-deer","owner":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atlasapi/atlas-deer","description":"the next version of atlas","fork":false,"url":"https://api.github.com/repos/atlasapi/atlas-deer","forks_url":"https://api.github.com/repos/atlasapi/atlas-deer/forks","keys_url":"https://api.github.com/repos/atlasapi/atlas-deer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atlasapi/atlas-deer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atlasapi/atlas-deer/teams","hooks_url":"https://api.github.com/repos/atlasapi/atlas-deer/hooks","issue_events_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/events{/number}","events_url":"https://api.github.com/repos/atlasapi/atlas-deer/events","assignees_url":"https://api.github.com/repos/atlasapi/atlas-deer/assignees{/user}","branches_url":"https://api.github.com/repos/atlasapi/atlas-deer/branches{/branch}","tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/tags","blobs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/refs{/sha}","trees_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/{sha}","languages_url":"https://api.github.com/repos/atlasapi/atlas-deer/languages","stargazers_url":"https://api.github.com/repos/atlasapi/atlas-deer/stargazers","contributors_url":"https://api.github.com/repos/atlasapi/atlas-deer/contributors","subscribers_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscribers","subscription_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscription","commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/commits{/sha}","git_commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/commits{/sha}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/comments{/number}","issue_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/comments{/number}","contents_url":"https://api.github.com/repos/atlasapi/atlas-deer/contents/{+path}","compare_url":"https://api.github.com/repos/atlasapi/atlas-deer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atlasapi/atlas-deer/merges","archive_url":"https://api.github.com/repos/atlasapi/atlas-deer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atlasapi/atlas-deer/downloads","issues_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues{/number}","pulls_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls{/number}","milestones_url":"https://api.github.com/repos/atlasapi/atlas-deer/milestones{/number}","notifications_url":"https://api.github.com/repos/atlasapi/atlas-deer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atlasapi/atlas-deer/labels{/name}","releases_url":"https://api.github.com/repos/atlasapi/atlas-deer/releases{/id}","created_at":"2013-11-04T17:07:28Z","updated_at":"2015-03-23T10:53:39Z","pushed_at":"2015-03-23T15:46:13Z","git_url":"git://github.com/atlasapi/atlas-deer.git","ssh_url":"git@github.com:atlasapi/atlas-deer.git","clone_url":"https://github.com/atlasapi/atlas-deer.git","svn_url":"https://github.com/atlasapi/atlas-deer","homepage":null,"size":4690,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"atlasapi:master","ref":"master","sha":"9fd9b2f0e70c37b44101ad848917f616a0193336","user":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"repo":{"id":14117583,"name":"atlas-deer","full_name":"atlasapi/atlas-deer","owner":{"login":"atlasapi","id":325129,"avatar_url":"https://avatars.githubusercontent.com/u/325129?v=3","gravatar_id":"","url":"https://api.github.com/users/atlasapi","html_url":"https://github.com/atlasapi","followers_url":"https://api.github.com/users/atlasapi/followers","following_url":"https://api.github.com/users/atlasapi/following{/other_user}","gists_url":"https://api.github.com/users/atlasapi/gists{/gist_id}","starred_url":"https://api.github.com/users/atlasapi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atlasapi/subscriptions","organizations_url":"https://api.github.com/users/atlasapi/orgs","repos_url":"https://api.github.com/users/atlasapi/repos","events_url":"https://api.github.com/users/atlasapi/events{/privacy}","received_events_url":"https://api.github.com/users/atlasapi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atlasapi/atlas-deer","description":"the next version of atlas","fork":false,"url":"https://api.github.com/repos/atlasapi/atlas-deer","forks_url":"https://api.github.com/repos/atlasapi/atlas-deer/forks","keys_url":"https://api.github.com/repos/atlasapi/atlas-deer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atlasapi/atlas-deer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atlasapi/atlas-deer/teams","hooks_url":"https://api.github.com/repos/atlasapi/atlas-deer/hooks","issue_events_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/events{/number}","events_url":"https://api.github.com/repos/atlasapi/atlas-deer/events","assignees_url":"https://api.github.com/repos/atlasapi/atlas-deer/assignees{/user}","branches_url":"https://api.github.com/repos/atlasapi/atlas-deer/branches{/branch}","tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/tags","blobs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/refs{/sha}","trees_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/{sha}","languages_url":"https://api.github.com/repos/atlasapi/atlas-deer/languages","stargazers_url":"https://api.github.com/repos/atlasapi/atlas-deer/stargazers","contributors_url":"https://api.github.com/repos/atlasapi/atlas-deer/contributors","subscribers_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscribers","subscription_url":"https://api.github.com/repos/atlasapi/atlas-deer/subscription","commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/commits{/sha}","git_commits_url":"https://api.github.com/repos/atlasapi/atlas-deer/git/commits{/sha}","comments_url":"https://api.github.com/repos/atlasapi/atlas-deer/comments{/number}","issue_comment_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues/comments{/number}","contents_url":"https://api.github.com/repos/atlasapi/atlas-deer/contents/{+path}","compare_url":"https://api.github.com/repos/atlasapi/atlas-deer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atlasapi/atlas-deer/merges","archive_url":"https://api.github.com/repos/atlasapi/atlas-deer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atlasapi/atlas-deer/downloads","issues_url":"https://api.github.com/repos/atlasapi/atlas-deer/issues{/number}","pulls_url":"https://api.github.com/repos/atlasapi/atlas-deer/pulls{/number}","milestones_url":"https://api.github.com/repos/atlasapi/atlas-deer/milestones{/number}","notifications_url":"https://api.github.com/repos/atlasapi/atlas-deer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atlasapi/atlas-deer/labels{/name}","releases_url":"https://api.github.com/repos/atlasapi/atlas-deer/releases{/id}","created_at":"2013-11-04T17:07:28Z","updated_at":"2015-03-23T10:53:39Z","pushed_at":"2015-03-23T15:46:13Z","git_url":"git://github.com/atlasapi/atlas-deer.git","ssh_url":"git@github.com:atlasapi/atlas-deer.git","clone_url":"https://github.com/atlasapi/atlas-deer.git","svn_url":"https://github.com/atlasapi/atlas-deer","homepage":null,"size":4690,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74"},"html":{"href":"https://github.com/atlasapi/atlas-deer/pull/74"},"issue":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/issues/74"},"comments":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/atlasapi/atlas-deer/statuses/e1f581ebdf7f6d450be1ca4cf70e7f437a6f19cb"}}}}