{"action":"created","comment":{"url":"https://api.github.com/repos/azkaban/azkaban/pulls/comments/111854692","pull_request_review_id":33124927,"id":111854692,"diff_hunk":"@@ -0,0 +1,85 @@\n+/*\n+ * Copyright 2017 LinkedIn Corp.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+ * use this file except in compliance with the License. You may obtain a copy of\n+ * 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n+ * License for the specific language governing permissions and limitations under\n+ * the License.\n+ *\n+ */\n+package azkaban;\n+\n+import azkaban.project.JdbcProjectLoader;\n+import azkaban.project.ProjectLoader;\n+import azkaban.spi.Storage;\n+import azkaban.spi.StorageException;\n+import azkaban.storage.LocalStorage;\n+import azkaban.storage.StorageConfig;\n+import azkaban.storage.StorageImplementationType;\n+import azkaban.utils.Props;\n+import com.google.inject.AbstractModule;\n+import com.google.inject.Inject;\n+import com.google.inject.Provides;\n+import com.google.inject.Scopes;\n+import com.google.inject.Singleton;\n+import java.io.File;\n+\n+import static azkaban.storage.StorageImplementationType.*;\n+\n+\n+public class AzkabanCommonModule extends AbstractModule {\n+  private final Props props;\n+  /**\n+   * Storage Implementation\n+   * This can be any of the {@link StorageImplementationType} values in which case {@link StorageFactory} will create\n+   * the appropriate storage instance. Or one can feed in a custom implementation class using the full qualified\n+   * path required by a classloader.\n+   *\n+   * examples: LOCAL, DATABASE, azkaban.storage.MyFavStorage\n+   *\n+   */\n+  private final String storageImplementation;\n+\n+  public AzkabanCommonModule(Props props) {\n+    this.props = props;\n+    this.storageImplementation = props.getString(Constants.ConfigurationKeys.AZKABAN_STORAGE_TYPE, LOCAL.name());\n+  }\n+\n+  @Override\n+  protected void configure() {\n+    bind(ProjectLoader.class).to(JdbcProjectLoader.class).in(Scopes.SINGLETON);\n+    bind(Props.class).toInstance(props);\n+    bind(Storage.class).to(resolveStorageClassType()).in(Scopes.SINGLETON);","path":"azkaban-common/src/main/java/azkaban/AzkabanCommonModule.java","position":59,"original_position":59,"commit_id":"987573efc0d408b6d8aab33f6db3acd9664157e3","original_commit_id":"987573efc0d408b6d8aab33f6db3acd9664157e3","user":{"login":"HappyRay","id":6646529,"avatar_url":"https://avatars2.githubusercontent.com/u/6646529?v=3","gravatar_id":"","url":"https://api.github.com/users/HappyRay","html_url":"https://github.com/HappyRay","followers_url":"https://api.github.com/users/HappyRay/followers","following_url":"https://api.github.com/users/HappyRay/following{/other_user}","gists_url":"https://api.github.com/users/HappyRay/gists{/gist_id}","starred_url":"https://api.github.com/users/HappyRay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HappyRay/subscriptions","organizations_url":"https://api.github.com/users/HappyRay/orgs","repos_url":"https://api.github.com/users/HappyRay/repos","events_url":"https://api.github.com/users/HappyRay/events{/privacy}","received_events_url":"https://api.github.com/users/HappyRay/received_events","type":"User","site_admin":false},"body":"Is in(Scopes.SINGLETON) necessary here since the provider has the singleton annotation already.","created_at":"2017-04-18T01:19:37Z","updated_at":"2017-04-18T01:27:24Z","html_url":"https://github.com/azkaban/azkaban/pull/991#discussion_r111854692","pull_request_url":"https://api.github.com/repos/azkaban/azkaban/pulls/991","_links":{"self":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/comments/111854692"},"html":{"href":"https://github.com/azkaban/azkaban/pull/991#discussion_r111854692"},"pull_request":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/991"}}},"pull_request":{"url":"https://api.github.com/repos/azkaban/azkaban/pulls/991","id":116232485,"html_url":"https://github.com/azkaban/azkaban/pull/991","diff_url":"https://github.com/azkaban/azkaban/pull/991.diff","patch_url":"https://github.com/azkaban/azkaban/pull/991.patch","issue_url":"https://api.github.com/repos/azkaban/azkaban/issues/991","number":991,"state":"open","locked":false,"title":"Storage Stubs and Implementation + Guice Service Provider","user":{"login":"suvodeep-pyne","id":2577714,"avatar_url":"https://avatars2.githubusercontent.com/u/2577714?v=3","gravatar_id":"","url":"https://api.github.com/users/suvodeep-pyne","html_url":"https://github.com/suvodeep-pyne","followers_url":"https://api.github.com/users/suvodeep-pyne/followers","following_url":"https://api.github.com/users/suvodeep-pyne/following{/other_user}","gists_url":"https://api.github.com/users/suvodeep-pyne/gists{/gist_id}","starred_url":"https://api.github.com/users/suvodeep-pyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suvodeep-pyne/subscriptions","organizations_url":"https://api.github.com/users/suvodeep-pyne/orgs","repos_url":"https://api.github.com/users/suvodeep-pyne/repos","events_url":"https://api.github.com/users/suvodeep-pyne/events{/privacy}","received_events_url":"https://api.github.com/users/suvodeep-pyne/received_events","type":"User","site_admin":false},"body":"This patch introduces a `ServiceProvider` interface powered by `Guice` which is also a new dependency for Azkaban. This was required to implement some of the storage implementation code.\r\n\r\nStorage API changes\r\n - refactored some of the storage APIs\r\n - Implemented Local storage for Azkaban + unit test\r\n - Included Stub for Database Storage.\r\n\r\nNone of these code paths are invoked anywhere in the codebase at this time. So this should not affect any existing code. Just wanted to break up my changes into smaller chunks to make it easier to review.","created_at":"2017-04-18T01:08:09Z","updated_at":"2017-04-18T01:27:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b539c95c03d5eacdd9d5099431c457d8e918fa3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/azkaban/azkaban/pulls/991/commits","review_comments_url":"https://api.github.com/repos/azkaban/azkaban/pulls/991/comments","review_comment_url":"https://api.github.com/repos/azkaban/azkaban/pulls/comments{/number}","comments_url":"https://api.github.com/repos/azkaban/azkaban/issues/991/comments","statuses_url":"https://api.github.com/repos/azkaban/azkaban/statuses/987573efc0d408b6d8aab33f6db3acd9664157e3","head":{"label":"suvodeep-pyne:guice-local-storage","ref":"guice-local-storage","sha":"987573efc0d408b6d8aab33f6db3acd9664157e3","user":{"login":"suvodeep-pyne","id":2577714,"avatar_url":"https://avatars2.githubusercontent.com/u/2577714?v=3","gravatar_id":"","url":"https://api.github.com/users/suvodeep-pyne","html_url":"https://github.com/suvodeep-pyne","followers_url":"https://api.github.com/users/suvodeep-pyne/followers","following_url":"https://api.github.com/users/suvodeep-pyne/following{/other_user}","gists_url":"https://api.github.com/users/suvodeep-pyne/gists{/gist_id}","starred_url":"https://api.github.com/users/suvodeep-pyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suvodeep-pyne/subscriptions","organizations_url":"https://api.github.com/users/suvodeep-pyne/orgs","repos_url":"https://api.github.com/users/suvodeep-pyne/repos","events_url":"https://api.github.com/users/suvodeep-pyne/events{/privacy}","received_events_url":"https://api.github.com/users/suvodeep-pyne/received_events","type":"User","site_admin":false},"repo":{"id":60558822,"name":"azkaban","full_name":"suvodeep-pyne/azkaban","owner":{"login":"suvodeep-pyne","id":2577714,"avatar_url":"https://avatars2.githubusercontent.com/u/2577714?v=3","gravatar_id":"","url":"https://api.github.com/users/suvodeep-pyne","html_url":"https://github.com/suvodeep-pyne","followers_url":"https://api.github.com/users/suvodeep-pyne/followers","following_url":"https://api.github.com/users/suvodeep-pyne/following{/other_user}","gists_url":"https://api.github.com/users/suvodeep-pyne/gists{/gist_id}","starred_url":"https://api.github.com/users/suvodeep-pyne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suvodeep-pyne/subscriptions","organizations_url":"https://api.github.com/users/suvodeep-pyne/orgs","repos_url":"https://api.github.com/users/suvodeep-pyne/repos","events_url":"https://api.github.com/users/suvodeep-pyne/events{/privacy}","received_events_url":"https://api.github.com/users/suvodeep-pyne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/suvodeep-pyne/azkaban","description":"Azkaban workflow manager.","fork":true,"url":"https://api.github.com/repos/suvodeep-pyne/azkaban","forks_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/forks","keys_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/keys{/key_id}","collaborators_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/teams","hooks_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/hooks","issue_events_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/issues/events{/number}","events_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/events","assignees_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/assignees{/user}","branches_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/branches{/branch}","tags_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/tags","blobs_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/git/refs{/sha}","trees_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/git/trees{/sha}","statuses_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/statuses/{sha}","languages_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/languages","stargazers_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/stargazers","contributors_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/contributors","subscribers_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/subscribers","subscription_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/subscription","commits_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/commits{/sha}","git_commits_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/git/commits{/sha}","comments_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/comments{/number}","issue_comment_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/issues/comments{/number}","contents_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/contents/{+path}","compare_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/compare/{base}...{head}","merges_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/merges","archive_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/downloads","issues_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/issues{/number}","pulls_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/pulls{/number}","milestones_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/milestones{/number}","notifications_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/labels{/name}","releases_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/releases{/id}","deployments_url":"https://api.github.com/repos/suvodeep-pyne/azkaban/deployments","created_at":"2016-06-06T20:31:49Z","updated_at":"2016-06-06T20:31:54Z","pushed_at":"2017-04-18T01:17:55Z","git_url":"git://github.com/suvodeep-pyne/azkaban.git","ssh_url":"git@github.com:suvodeep-pyne/azkaban.git","clone_url":"https://github.com/suvodeep-pyne/azkaban.git","svn_url":"https://github.com/suvodeep-pyne/azkaban","homepage":"https://azkaban.github.io","size":37487,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"azkaban:master","ref":"master","sha":"0fe1df9d5b0be4d01aca4b2377f1edacbce0fdf1","user":{"login":"azkaban","id":213618,"avatar_url":"https://avatars3.githubusercontent.com/u/213618?v=3","gravatar_id":"","url":"https://api.github.com/users/azkaban","html_url":"https://github.com/azkaban","followers_url":"https://api.github.com/users/azkaban/followers","following_url":"https://api.github.com/users/azkaban/following{/other_user}","gists_url":"https://api.github.com/users/azkaban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkaban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkaban/subscriptions","organizations_url":"https://api.github.com/users/azkaban/orgs","repos_url":"https://api.github.com/users/azkaban/repos","events_url":"https://api.github.com/users/azkaban/events{/privacy}","received_events_url":"https://api.github.com/users/azkaban/received_events","type":"Organization","site_admin":false},"repo":{"id":6271421,"name":"azkaban","full_name":"azkaban/azkaban","owner":{"login":"azkaban","id":213618,"avatar_url":"https://avatars3.githubusercontent.com/u/213618?v=3","gravatar_id":"","url":"https://api.github.com/users/azkaban","html_url":"https://github.com/azkaban","followers_url":"https://api.github.com/users/azkaban/followers","following_url":"https://api.github.com/users/azkaban/following{/other_user}","gists_url":"https://api.github.com/users/azkaban/gists{/gist_id}","starred_url":"https://api.github.com/users/azkaban/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azkaban/subscriptions","organizations_url":"https://api.github.com/users/azkaban/orgs","repos_url":"https://api.github.com/users/azkaban/repos","events_url":"https://api.github.com/users/azkaban/events{/privacy}","received_events_url":"https://api.github.com/users/azkaban/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azkaban/azkaban","description":"Azkaban workflow manager.","fork":false,"url":"https://api.github.com/repos/azkaban/azkaban","forks_url":"https://api.github.com/repos/azkaban/azkaban/forks","keys_url":"https://api.github.com/repos/azkaban/azkaban/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azkaban/azkaban/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azkaban/azkaban/teams","hooks_url":"https://api.github.com/repos/azkaban/azkaban/hooks","issue_events_url":"https://api.github.com/repos/azkaban/azkaban/issues/events{/number}","events_url":"https://api.github.com/repos/azkaban/azkaban/events","assignees_url":"https://api.github.com/repos/azkaban/azkaban/assignees{/user}","branches_url":"https://api.github.com/repos/azkaban/azkaban/branches{/branch}","tags_url":"https://api.github.com/repos/azkaban/azkaban/tags","blobs_url":"https://api.github.com/repos/azkaban/azkaban/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azkaban/azkaban/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azkaban/azkaban/git/refs{/sha}","trees_url":"https://api.github.com/repos/azkaban/azkaban/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azkaban/azkaban/statuses/{sha}","languages_url":"https://api.github.com/repos/azkaban/azkaban/languages","stargazers_url":"https://api.github.com/repos/azkaban/azkaban/stargazers","contributors_url":"https://api.github.com/repos/azkaban/azkaban/contributors","subscribers_url":"https://api.github.com/repos/azkaban/azkaban/subscribers","subscription_url":"https://api.github.com/repos/azkaban/azkaban/subscription","commits_url":"https://api.github.com/repos/azkaban/azkaban/commits{/sha}","git_commits_url":"https://api.github.com/repos/azkaban/azkaban/git/commits{/sha}","comments_url":"https://api.github.com/repos/azkaban/azkaban/comments{/number}","issue_comment_url":"https://api.github.com/repos/azkaban/azkaban/issues/comments{/number}","contents_url":"https://api.github.com/repos/azkaban/azkaban/contents/{+path}","compare_url":"https://api.github.com/repos/azkaban/azkaban/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azkaban/azkaban/merges","archive_url":"https://api.github.com/repos/azkaban/azkaban/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azkaban/azkaban/downloads","issues_url":"https://api.github.com/repos/azkaban/azkaban/issues{/number}","pulls_url":"https://api.github.com/repos/azkaban/azkaban/pulls{/number}","milestones_url":"https://api.github.com/repos/azkaban/azkaban/milestones{/number}","notifications_url":"https://api.github.com/repos/azkaban/azkaban/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azkaban/azkaban/labels{/name}","releases_url":"https://api.github.com/repos/azkaban/azkaban/releases{/id}","deployments_url":"https://api.github.com/repos/azkaban/azkaban/deployments","created_at":"2012-10-18T01:34:53Z","updated_at":"2017-04-16T12:59:00Z","pushed_at":"2017-04-18T01:17:56Z","git_url":"git://github.com/azkaban/azkaban.git","ssh_url":"git@github.com:azkaban/azkaban.git","clone_url":"https://github.com/azkaban/azkaban.git","svn_url":"https://github.com/azkaban/azkaban","homepage":"https://azkaban.github.io","size":33619,"stargazers_count":1106,"watchers_count":1106,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":578,"mirror_url":null,"open_issues_count":296,"forks":578,"open_issues":296,"watchers":1106,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/991"},"html":{"href":"https://github.com/azkaban/azkaban/pull/991"},"issue":{"href":"https://api.github.com/repos/azkaban/azkaban/issues/991"},"comments":{"href":"https://api.github.com/repos/azkaban/azkaban/issues/991/comments"},"review_comments":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/991/comments"},"review_comment":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/azkaban/azkaban/pulls/991/commits"},"statuses":{"href":"https://api.github.com/repos/azkaban/azkaban/statuses/987573efc0d408b6d8aab33f6db3acd9664157e3"}}}}
{"actor":{"display_login":"HappyRay"}}