{"action":"created","comment":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/comments/195521842","pull_request_review_id":128908608,"id":195521842,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTUyMTg0Mg==","diff_hunk":"@@ -0,0 +1,116 @@\n+/*\n+ * Copyright © 2018 Cask Data, Inc.\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 co.cask.cdap.internal.profile;\n+\n+import co.cask.cdap.api.Transactional;\n+import co.cask.cdap.api.Transactionals;\n+import co.cask.cdap.api.data.DatasetContext;\n+import co.cask.cdap.common.NotFoundException;\n+import co.cask.cdap.common.ProfileConflictException;\n+import co.cask.cdap.config.Config;\n+import co.cask.cdap.config.ConfigDataset;\n+import co.cask.cdap.config.PreferencesStore;\n+import co.cask.cdap.data.dataset.SystemDatasetInstantiator;\n+import co.cask.cdap.data2.dataset2.DatasetFramework;\n+import co.cask.cdap.data2.dataset2.MultiThreadDatasetCache;\n+import co.cask.cdap.data2.transaction.Transactions;\n+import co.cask.cdap.internal.app.runtime.SystemArguments;\n+import co.cask.cdap.internal.app.store.profile.ProfileDataset;\n+import co.cask.cdap.proto.id.NamespaceId;\n+import co.cask.cdap.proto.id.ProfileId;\n+import co.cask.cdap.proto.profile.Profile;\n+import co.cask.cdap.runtime.spi.profile.ProfileStatus;\n+import org.apache.tephra.RetryStrategies;\n+import org.apache.tephra.TransactionSystemClient;\n+\n+import java.util.Collections;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Optional;\n+import javax.inject.Inject;\n+\n+/**\n+ * This class is to manage profile related functions. For any store related operations,\n+ * it will directly get any underlying table.\n+ */\n+public class ProfileService {\n+  private final DatasetFramework datasetFramework;\n+  private final Transactional transactional;\n+\n+  @Inject\n+  public ProfileService(DatasetFramework datasetFramework, TransactionSystemClient txClient) {\n+    this.datasetFramework = datasetFramework;\n+    this.transactional = Transactions.createTransactionalWithRetry(\n+      Transactions.createTransactional(new MultiThreadDatasetCache(new SystemDatasetInstantiator(datasetFramework),\n+        txClient, NamespaceId.SYSTEM,\n+        Collections.emptyMap(), null, null)),\n+      RetryStrategies.retryOnConflict(20, 100)\n+    );\n+  }\n+","path":"cdap-app-fabric/src/main/java/co/cask/cdap/internal/profile/ProfileService.java","position":64,"original_position":64,"commit_id":"f3496a34b0f3c62c4beb1889a26a6e541f45deeb","original_commit_id":"eec708e8ed5608f93993f743ad9a0532352c9e7d","user":{"login":"yaojiefeng","id":12615579,"node_id":"MDQ6VXNlcjEyNjE1NTc5","avatar_url":"https://avatars0.githubusercontent.com/u/12615579?v=4","gravatar_id":"","url":"https://api.github.com/users/yaojiefeng","html_url":"https://github.com/yaojiefeng","followers_url":"https://api.github.com/users/yaojiefeng/followers","following_url":"https://api.github.com/users/yaojiefeng/following{/other_user}","gists_url":"https://api.github.com/users/yaojiefeng/gists{/gist_id}","starred_url":"https://api.github.com/users/yaojiefeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaojiefeng/subscriptions","organizations_url":"https://api.github.com/users/yaojiefeng/orgs","repos_url":"https://api.github.com/users/yaojiefeng/repos","events_url":"https://api.github.com/users/yaojiefeng/events{/privacy}","received_events_url":"https://api.github.com/users/yaojiefeng/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2018-06-14T18:13:21Z","updated_at":"2018-06-14T18:13:21Z","html_url":"https://github.com/caskdata/cdap/pull/10181#discussion_r195521842","pull_request_url":"https://api.github.com/repos/caskdata/cdap/pulls/10181","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments/195521842"},"html":{"href":"https://github.com/caskdata/cdap/pull/10181#discussion_r195521842"},"pull_request":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10181"}},"in_reply_to_id":195512650},"pull_request":{"url":"https://api.github.com/repos/caskdata/cdap/pulls/10181","id":193484728,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzNDg0NzI4","html_url":"https://github.com/caskdata/cdap/pull/10181","diff_url":"https://github.com/caskdata/cdap/pull/10181.diff","patch_url":"https://github.com/caskdata/cdap/pull/10181.patch","issue_url":"https://api.github.com/repos/caskdata/cdap/issues/10181","number":10181,"state":"open","locked":false,"title":"Feature/cdap 13494 add profile status","user":{"login":"yaojiefeng","id":12615579,"node_id":"MDQ6VXNlcjEyNjE1NTc5","avatar_url":"https://avatars0.githubusercontent.com/u/12615579?v=4","gravatar_id":"","url":"https://api.github.com/users/yaojiefeng","html_url":"https://github.com/yaojiefeng","followers_url":"https://api.github.com/users/yaojiefeng/followers","following_url":"https://api.github.com/users/yaojiefeng/following{/other_user}","gists_url":"https://api.github.com/users/yaojiefeng/gists{/gist_id}","starred_url":"https://api.github.com/users/yaojiefeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaojiefeng/subscriptions","organizations_url":"https://api.github.com/users/yaojiefeng/orgs","repos_url":"https://api.github.com/users/yaojiefeng/repos","events_url":"https://api.github.com/users/yaojiefeng/events{/privacy}","received_events_url":"https://api.github.com/users/yaojiefeng/received_events","type":"User","site_admin":false},"body":"JIRA: https://issues.cask.co/browse/CDAP-13494\r\nBuild: https://builds.cask.co/browse/CDAP-DUT6468-3\r\n\r\nThis pr adds profile status ENABLED and DISABLED, and put restrictions on setting preference/deploy app/update schedules/start a program based on the status of the profile status. \r\n profile -> entity association will come in next pr\r\n","created_at":"2018-06-08T01:03:14Z","updated_at":"2018-06-14T18:13:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8faf5ee43df79e4a416136391613343a103d9721","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/caskdata/cdap/pulls/10181/commits","review_comments_url":"https://api.github.com/repos/caskdata/cdap/pulls/10181/comments","review_comment_url":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caskdata/cdap/issues/10181/comments","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/f3496a34b0f3c62c4beb1889a26a6e541f45deeb","head":{"label":"caskdata:feature/CDAP-13494-add-profile-status","ref":"feature/CDAP-13494-add-profile-status","sha":"f3496a34b0f3c62c4beb1889a26a6e541f45deeb","user":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"node_id":"MDEwOlJlcG9zaXRvcnkyMjU0Mjc1OQ==","name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"A Unified Integration Platform - Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","deployments_url":"https://api.github.com/repos/caskdata/cdap/deployments","created_at":"2014-08-02T09:00:10Z","updated_at":"2018-06-14T17:14:53Z","pushed_at":"2018-06-14T18:13:06Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://docs.cask.co/cdap","size":533224,"stargazers_count":234,"watchers_count":234,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":117,"open_issues":28,"watchers":234,"default_branch":"develop"}},"base":{"label":"caskdata:develop","ref":"develop","sha":"581c2f6dca78f4c2c7477524bafc1adc4692c492","user":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"repo":{"id":22542759,"node_id":"MDEwOlJlcG9zaXRvcnkyMjU0Mjc1OQ==","name":"cdap","full_name":"caskdata/cdap","owner":{"login":"caskdata","id":8123023,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMjMwMjM=","avatar_url":"https://avatars2.githubusercontent.com/u/8123023?v=4","gravatar_id":"","url":"https://api.github.com/users/caskdata","html_url":"https://github.com/caskdata","followers_url":"https://api.github.com/users/caskdata/followers","following_url":"https://api.github.com/users/caskdata/following{/other_user}","gists_url":"https://api.github.com/users/caskdata/gists{/gist_id}","starred_url":"https://api.github.com/users/caskdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caskdata/subscriptions","organizations_url":"https://api.github.com/users/caskdata/orgs","repos_url":"https://api.github.com/users/caskdata/repos","events_url":"https://api.github.com/users/caskdata/events{/privacy}","received_events_url":"https://api.github.com/users/caskdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/caskdata/cdap","description":"A Unified Integration Platform - Cask Data Application Platform (CDAP)","fork":false,"url":"https://api.github.com/repos/caskdata/cdap","forks_url":"https://api.github.com/repos/caskdata/cdap/forks","keys_url":"https://api.github.com/repos/caskdata/cdap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caskdata/cdap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caskdata/cdap/teams","hooks_url":"https://api.github.com/repos/caskdata/cdap/hooks","issue_events_url":"https://api.github.com/repos/caskdata/cdap/issues/events{/number}","events_url":"https://api.github.com/repos/caskdata/cdap/events","assignees_url":"https://api.github.com/repos/caskdata/cdap/assignees{/user}","branches_url":"https://api.github.com/repos/caskdata/cdap/branches{/branch}","tags_url":"https://api.github.com/repos/caskdata/cdap/tags","blobs_url":"https://api.github.com/repos/caskdata/cdap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caskdata/cdap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caskdata/cdap/git/refs{/sha}","trees_url":"https://api.github.com/repos/caskdata/cdap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caskdata/cdap/statuses/{sha}","languages_url":"https://api.github.com/repos/caskdata/cdap/languages","stargazers_url":"https://api.github.com/repos/caskdata/cdap/stargazers","contributors_url":"https://api.github.com/repos/caskdata/cdap/contributors","subscribers_url":"https://api.github.com/repos/caskdata/cdap/subscribers","subscription_url":"https://api.github.com/repos/caskdata/cdap/subscription","commits_url":"https://api.github.com/repos/caskdata/cdap/commits{/sha}","git_commits_url":"https://api.github.com/repos/caskdata/cdap/git/commits{/sha}","comments_url":"https://api.github.com/repos/caskdata/cdap/comments{/number}","issue_comment_url":"https://api.github.com/repos/caskdata/cdap/issues/comments{/number}","contents_url":"https://api.github.com/repos/caskdata/cdap/contents/{+path}","compare_url":"https://api.github.com/repos/caskdata/cdap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caskdata/cdap/merges","archive_url":"https://api.github.com/repos/caskdata/cdap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caskdata/cdap/downloads","issues_url":"https://api.github.com/repos/caskdata/cdap/issues{/number}","pulls_url":"https://api.github.com/repos/caskdata/cdap/pulls{/number}","milestones_url":"https://api.github.com/repos/caskdata/cdap/milestones{/number}","notifications_url":"https://api.github.com/repos/caskdata/cdap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caskdata/cdap/labels{/name}","releases_url":"https://api.github.com/repos/caskdata/cdap/releases{/id}","deployments_url":"https://api.github.com/repos/caskdata/cdap/deployments","created_at":"2014-08-02T09:00:10Z","updated_at":"2018-06-14T17:14:53Z","pushed_at":"2018-06-14T18:13:06Z","git_url":"git://github.com/caskdata/cdap.git","ssh_url":"git@github.com:caskdata/cdap.git","clone_url":"https://github.com/caskdata/cdap.git","svn_url":"https://github.com/caskdata/cdap","homepage":"http://docs.cask.co/cdap","size":533224,"stargazers_count":234,"watchers_count":234,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":28,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":117,"open_issues":28,"watchers":234,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10181"},"html":{"href":"https://github.com/caskdata/cdap/pull/10181"},"issue":{"href":"https://api.github.com/repos/caskdata/cdap/issues/10181"},"comments":{"href":"https://api.github.com/repos/caskdata/cdap/issues/10181/comments"},"review_comments":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10181/comments"},"review_comment":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caskdata/cdap/pulls/10181/commits"},"statuses":{"href":"https://api.github.com/repos/caskdata/cdap/statuses/f3496a34b0f3c62c4beb1889a26a6e541f45deeb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yaojiefeng"}}