{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/35918437","id":35918437,"diff_hunk":"@@ -471,4 +502,62 @@ public JobExecutionInfo toJobExecutionInfo() {\n \n     return jobExecutionInfo;\n   }\n+\n+  /**\n+   * Create a new {@link JobState.DatasetState} based on this {@link JobState} instance.\n+   *\n+   * @return a new {@link JobState.DatasetState} object\n+   */\n+  public DatasetState newDatasetState(boolean addTaskStates) {\n+    DatasetState datasetState = new DatasetState(this.jobName, this.jobId);\n+    datasetState.addAll(this);\n+    datasetState.setState(this.state);\n+    if (addTaskStates) {\n+      datasetState.addTaskStates(this.taskStates.values());\n+    }\n+    return datasetState;\n+  }\n+\n+  private static List<WorkUnitState> workUnitStatesFromDatasetStates(Iterable<JobState.DatasetState> datasetStates) {\n+    ImmutableList.Builder<WorkUnitState> taskStateBuilder = ImmutableList.builder();\n+    for (JobState datasetState : datasetStates) {\n+      taskStateBuilder.addAll(datasetState.getTaskStatesAsWorkUnitStates());\n+    }\n+    return taskStateBuilder.build();\n+  }\n+\n+  /**\n+   * A subclass of {@link JobState} that is used to represent dataset states. This class is currently\n+   * identical to {@link JobState} except that the name is more meaningful and less confusing.\n+   */\n+  public static class DatasetState extends JobState {\n+\n+    // For serialization/deserialization\n+    @SuppressWarnings(\"unused\")","path":"gobblin-runtime/src/main/java/gobblin/runtime/JobState.java","position":100,"original_position":100,"commit_id":"a120de90cba5e19c7d9ddf624a6c4ca8e3c444a0","original_commit_id":"a120de90cba5e19c7d9ddf624a6c4ca8e3c444a0","user":{"login":"zliu41","id":6342538,"avatar_url":"https://avatars.githubusercontent.com/u/6342538?v=3","gravatar_id":"","url":"https://api.github.com/users/zliu41","html_url":"https://github.com/zliu41","followers_url":"https://api.github.com/users/zliu41/followers","following_url":"https://api.github.com/users/zliu41/following{/other_user}","gists_url":"https://api.github.com/users/zliu41/gists{/gist_id}","starred_url":"https://api.github.com/users/zliu41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zliu41/subscriptions","organizations_url":"https://api.github.com/users/zliu41/orgs","repos_url":"https://api.github.com/users/zliu41/repos","events_url":"https://api.github.com/users/zliu41/events{/privacy}","received_events_url":"https://api.github.com/users/zliu41/received_events","type":"User","site_admin":false},"body":"This seems unnecessary","created_at":"2015-07-30T20:47:22Z","updated_at":"2015-07-30T20:47:22Z","html_url":"https://github.com/linkedin/gobblin/pull/254#discussion_r35918437","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/254","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/35918437"},"html":{"href":"https://github.com/linkedin/gobblin/pull/254#discussion_r35918437"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/254"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/254","id":41160853,"html_url":"https://github.com/linkedin/gobblin/pull/254","diff_url":"https://github.com/linkedin/gobblin/pull/254.diff","patch_url":"https://github.com/linkedin/gobblin/pull/254.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/254","number":254,"state":"open","locked":false,"title":"Persist state and commit data on a per-dataset basis","user":{"login":"liyinan926","id":3709137,"avatar_url":"https://avatars.githubusercontent.com/u/3709137?v=3","gravatar_id":"","url":"https://api.github.com/users/liyinan926","html_url":"https://github.com/liyinan926","followers_url":"https://api.github.com/users/liyinan926/followers","following_url":"https://api.github.com/users/liyinan926/following{/other_user}","gists_url":"https://api.github.com/users/liyinan926/gists{/gist_id}","starred_url":"https://api.github.com/users/liyinan926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyinan926/subscriptions","organizations_url":"https://api.github.com/users/liyinan926/orgs","repos_url":"https://api.github.com/users/liyinan926/repos","events_url":"https://api.github.com/users/liyinan926/events{/privacy}","received_events_url":"https://api.github.com/users/liyinan926/received_events","type":"User","site_admin":false},"body":"1. A `WorkUnit` can be specified to belong to a dataset group by using a new config property `dataset.urn`.\r\n2. Job/task state will be persisted on a per-dataset basis into different state store files, one per dataset. All `current` dataset state store files will be loaded in the next job run. \r\n3. Commit of data will be done on a per-dataset basis, allowing datasets to be committed independently.\r\n4. For existing job that does not have a dataset concept or only deals with a single dataset, the logic of job/task state persistence and data commit remains the same.\r\n \r\nSigned-off-by: Yinan Li <liyinan926@gmail.com>","created_at":"2015-07-29T19:15:21Z","updated_at":"2015-07-30T20:47:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"901c0d60963d3115b094ae81336b02413041ff32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/254/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/254/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/254/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/a120de90cba5e19c7d9ddf624a6c4ca8e3c444a0","head":{"label":"liyinan926:master","ref":"master","sha":"a120de90cba5e19c7d9ddf624a6c4ca8e3c444a0","user":{"login":"liyinan926","id":3709137,"avatar_url":"https://avatars.githubusercontent.com/u/3709137?v=3","gravatar_id":"","url":"https://api.github.com/users/liyinan926","html_url":"https://github.com/liyinan926","followers_url":"https://api.github.com/users/liyinan926/followers","following_url":"https://api.github.com/users/liyinan926/following{/other_user}","gists_url":"https://api.github.com/users/liyinan926/gists{/gist_id}","starred_url":"https://api.github.com/users/liyinan926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyinan926/subscriptions","organizations_url":"https://api.github.com/users/liyinan926/orgs","repos_url":"https://api.github.com/users/liyinan926/repos","events_url":"https://api.github.com/users/liyinan926/events{/privacy}","received_events_url":"https://api.github.com/users/liyinan926/received_events","type":"User","site_admin":false},"repo":{"id":31117112,"name":"gobblin","full_name":"liyinan926/gobblin","owner":{"login":"liyinan926","id":3709137,"avatar_url":"https://avatars.githubusercontent.com/u/3709137?v=3","gravatar_id":"","url":"https://api.github.com/users/liyinan926","html_url":"https://github.com/liyinan926","followers_url":"https://api.github.com/users/liyinan926/followers","following_url":"https://api.github.com/users/liyinan926/following{/other_user}","gists_url":"https://api.github.com/users/liyinan926/gists{/gist_id}","starred_url":"https://api.github.com/users/liyinan926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyinan926/subscriptions","organizations_url":"https://api.github.com/users/liyinan926/orgs","repos_url":"https://api.github.com/users/liyinan926/repos","events_url":"https://api.github.com/users/liyinan926/events{/privacy}","received_events_url":"https://api.github.com/users/liyinan926/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liyinan926/gobblin","description":"","fork":true,"url":"https://api.github.com/repos/liyinan926/gobblin","forks_url":"https://api.github.com/repos/liyinan926/gobblin/forks","keys_url":"https://api.github.com/repos/liyinan926/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liyinan926/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liyinan926/gobblin/teams","hooks_url":"https://api.github.com/repos/liyinan926/gobblin/hooks","issue_events_url":"https://api.github.com/repos/liyinan926/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/liyinan926/gobblin/events","assignees_url":"https://api.github.com/repos/liyinan926/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/liyinan926/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/liyinan926/gobblin/tags","blobs_url":"https://api.github.com/repos/liyinan926/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liyinan926/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liyinan926/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/liyinan926/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liyinan926/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/liyinan926/gobblin/languages","stargazers_url":"https://api.github.com/repos/liyinan926/gobblin/stargazers","contributors_url":"https://api.github.com/repos/liyinan926/gobblin/contributors","subscribers_url":"https://api.github.com/repos/liyinan926/gobblin/subscribers","subscription_url":"https://api.github.com/repos/liyinan926/gobblin/subscription","commits_url":"https://api.github.com/repos/liyinan926/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/liyinan926/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/liyinan926/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/liyinan926/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/liyinan926/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/liyinan926/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liyinan926/gobblin/merges","archive_url":"https://api.github.com/repos/liyinan926/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liyinan926/gobblin/downloads","issues_url":"https://api.github.com/repos/liyinan926/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/liyinan926/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/liyinan926/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/liyinan926/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liyinan926/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/liyinan926/gobblin/releases{/id}","created_at":"2015-02-21T06:07:55Z","updated_at":"2015-05-05T00:31:33Z","pushed_at":"2015-07-30T18:53:23Z","git_url":"git://github.com/liyinan926/gobblin.git","ssh_url":"git@github.com:liyinan926/gobblin.git","clone_url":"https://github.com/liyinan926/gobblin.git","svn_url":"https://github.com/liyinan926/gobblin","homepage":null,"size":78701,"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":"605c1a0b665a5f4ade248fe295546c1cd163f7e3","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-07-30T15:24:14Z","pushed_at":"2015-07-30T18:53:27Z","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":158358,"stargazers_count":104,"watchers_count":104,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":3,"forks":40,"open_issues":3,"watchers":104,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/254"},"html":{"href":"https://github.com/linkedin/gobblin/pull/254"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/254"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/254/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/254/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/254/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/a120de90cba5e19c7d9ddf624a6c4ca8e3c444a0"}}}}