{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/40127821","id":40127821,"diff_hunk":"@@ -48,21 +53,21 @@ public AvroHdfsTimePartitionedWithRecordCountsWriter(Destination destination, St\n   public void close() throws IOException {\n     super.close();\n \n-    String fileName = WriterUtils.getWriterFileName(this.properties, this.numBranches, this.branch, this.writerId,\n-        this.writerOutputFormat.getExtension());\n+    // Rewrite property writer.final.output.path due to renaming output files.\n+    this.properties.removeProp(ConfigurationKeys.WRITER_FINAL_OUTPUT_PATH);\n \n-    Path writerOutputDir = new Path(this.properties.getProp(ForkOperatorUtils\n-        .getPropertyNameForBranch(ConfigurationKeys.WRITER_OUTPUT_DIR, this.numBranches, this.branch)));\n+    for (Entry<Path, FsDataWriter<GenericRecord>> entry : this.pathToWriterMap.entrySet()) {\n \n-    for (Entry<Path, DataWriter<GenericRecord>> entry : this.pathToWriterMap.entrySet()) {\n-\n-      String filePathOld = new Path(entry.getKey(), fileName).toString();\n+      String filePathOld = entry.getValue().getOutputFilePath();\n \n       String filePathNew = filePathOld.substring(0, filePathOld.lastIndexOf(\".\")) + \".\"","path":"gobblin-core/src/main/java/gobblin/writer/AvroHdfsTimePartitionedWithRecordCountsWriter.java","position":null,"original_position":37,"commit_id":"c5260fc224429a6fc02229e8ead1a94639b5e1e1","original_commit_id":"98256f8f859c74cf0d564089e1ddee6324d5660c","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":"No it only returns the file name. But I'm now using Path.getParent() to get the parent folder, plus `Files.getNameWithoutExtension` to make it look cleaner.","created_at":"2015-09-22T18:51:03Z","updated_at":"2015-09-22T18:51:03Z","html_url":"https://github.com/linkedin/gobblin/pull/335#discussion_r40127821","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/335","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/40127821"},"html":{"href":"https://github.com/linkedin/gobblin/pull/335#discussion_r40127821"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/335"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/335","id":45503933,"html_url":"https://github.com/linkedin/gobblin/pull/335","diff_url":"https://github.com/linkedin/gobblin/pull/335.diff","patch_url":"https://github.com/linkedin/gobblin/pull/335.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/335","number":335,"state":"open","locked":false,"title":"Enable tasks to publish data","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":"Summary:\r\n\r\n- Data are published by tasks if `job.commit.policy=partial` and `publish.data.in.tasks=true`.\r\n- Added method `DataPublisher.publish(WorkUnitState)` to publish data for a single task.\r\n- Added a flag in `BaseDataPublisher.publishData()` to control whether to publish the data for a single task. When publishing for a single task, it checks the files against `writer.final.output.path` in the `WorkUnitState` to make sure it doesn't publish data written by other tasks.\r\n- In `AvroHdfsTimePartitionedWriter.close()`, it adds all files created by this writer to `writer.final.output.path`.\r\n- `AvroHdfsTimePartitionedWithRecordCountsWriter.close()` will rewrite `writer.final.output.path` upon renaming output file names to include row counts. It also gets the file names from `FsDataWriter` instead of constructing it itself, which is more consistent.\r\n- `Task` publishes data in the `finally` block since it needs to wait till `closer.close()` is called which closes all the forks and data writers.","created_at":"2015-09-20T20:56:34Z","updated_at":"2015-09-22T18:51:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0485bdaf7c15f4187d706ad9e35510c37657a04e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/335/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/335/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/335/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/c5260fc224429a6fc02229e8ead1a94639b5e1e1","head":{"label":"zliu41:task","ref":"task","sha":"c5260fc224429a6fc02229e8ead1a94639b5e1e1","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},"repo":{"id":32048123,"name":"gobblin","full_name":"zliu41/gobblin","owner":{"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},"private":false,"html_url":"https://github.com/zliu41/gobblin","description":"","fork":true,"url":"https://api.github.com/repos/zliu41/gobblin","forks_url":"https://api.github.com/repos/zliu41/gobblin/forks","keys_url":"https://api.github.com/repos/zliu41/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zliu41/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zliu41/gobblin/teams","hooks_url":"https://api.github.com/repos/zliu41/gobblin/hooks","issue_events_url":"https://api.github.com/repos/zliu41/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/zliu41/gobblin/events","assignees_url":"https://api.github.com/repos/zliu41/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/zliu41/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/zliu41/gobblin/tags","blobs_url":"https://api.github.com/repos/zliu41/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zliu41/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zliu41/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/zliu41/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zliu41/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/zliu41/gobblin/languages","stargazers_url":"https://api.github.com/repos/zliu41/gobblin/stargazers","contributors_url":"https://api.github.com/repos/zliu41/gobblin/contributors","subscribers_url":"https://api.github.com/repos/zliu41/gobblin/subscribers","subscription_url":"https://api.github.com/repos/zliu41/gobblin/subscription","commits_url":"https://api.github.com/repos/zliu41/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/zliu41/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/zliu41/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/zliu41/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/zliu41/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/zliu41/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zliu41/gobblin/merges","archive_url":"https://api.github.com/repos/zliu41/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zliu41/gobblin/downloads","issues_url":"https://api.github.com/repos/zliu41/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/zliu41/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/zliu41/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/zliu41/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zliu41/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/zliu41/gobblin/releases{/id}","created_at":"2015-03-12T00:17:48Z","updated_at":"2015-05-07T16:27:07Z","pushed_at":"2015-09-22T18:49:50Z","git_url":"git://github.com/zliu41/gobblin.git","ssh_url":"git@github.com:zliu41/gobblin.git","clone_url":"https://github.com/zliu41/gobblin.git","svn_url":"https://github.com/zliu41/gobblin","homepage":null,"size":79109,"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-22T18:39:35Z","pushed_at":"2015-09-22T18:49:50Z","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":160951,"stargazers_count":185,"watchers_count":185,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":9,"forks":66,"open_issues":9,"watchers":185,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/335"},"html":{"href":"https://github.com/linkedin/gobblin/pull/335"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/335"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/335/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/335/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/335/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/c5260fc224429a6fc02229e8ead1a94639b5e1e1"}}}}