{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/46449290","id":46449290,"diff_hunk":"@@ -178,31 +178,43 @@ public static void renameRecursively(FileSystem fileSystem, Path from, Path to)\n \n       Path toFilePath = new Path(to, relativeFilePath);\n \n-      if (!fileSystem.exists(toFilePath)) {\n-        /*\n-         * Permissions for newly created directories will be inherited from parent directory. This is because the source\n-         * and destination directory path may diverge after a certain level\n-         *\n-         * Source :/data/gobblin/task-staging/writer_1234/Log/file.txt\n-         *\n-         * Destination :/data/gobblin/task-output/Log/file.txt\n-         *\n-         * When the directory Log is being renamed from source to destination, task-output directory may not exist. It\n-         * will be created by inheriting it's parent permission (/data/gobblin/)\n-         */\n-        if (!fileSystem.exists(toFilePath.getParent())) {\n-          fileSystem.mkdirs(toFilePath.getParent());\n-        }\n-\n-        if (!fileSystem.rename(fromFile.getPath(), toFilePath)) {\n-          throw new IOException(String.format(\"Failed to rename %s to %s.\", fromFile.getPath(), toFilePath));\n+      if (!safeRenameIfNotExists(fileSystem, fromFile.getPath(), toFilePath)) {","path":"gobblin-utility/src/main/java/gobblin/util/HadoopUtils.java","position":22,"original_position":22,"commit_id":"b636c618ffad17def43f6b79b810e5290e649ab0","original_commit_id":"b636c618ffad17def43f6b79b810e5290e649ab0","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":"I saw you use `synchronized` for `safeRenameIfNotExists`. But this `if` block is a check-and-act compound operation that will not be thread safe even if `safeRenameIfNotExists` is.","created_at":"2015-12-02T17:57:12Z","updated_at":"2015-12-02T17:57:12Z","html_url":"https://github.com/linkedin/gobblin/pull/491#discussion_r46449290","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/491","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/46449290"},"html":{"href":"https://github.com/linkedin/gobblin/pull/491#discussion_r46449290"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/491"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/491","id":52313983,"html_url":"https://github.com/linkedin/gobblin/pull/491","diff_url":"https://github.com/linkedin/gobblin/pull/491.diff","patch_url":"https://github.com/linkedin/gobblin/pull/491.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/491","number":491,"state":"open","locked":false,"title":"Moved logic in RecursiveCopyableDataset to a CopyableDataset builder.","user":{"login":"ibuenros","id":1364112,"avatar_url":"https://avatars.githubusercontent.com/u/1364112?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuenros","html_url":"https://github.com/ibuenros","followers_url":"https://api.github.com/users/ibuenros/followers","following_url":"https://api.github.com/users/ibuenros/following{/other_user}","gists_url":"https://api.github.com/users/ibuenros/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuenros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuenros/subscriptions","organizations_url":"https://api.github.com/users/ibuenros/orgs","repos_url":"https://api.github.com/users/ibuenros/repos","events_url":"https://api.github.com/users/ibuenros/events{/privacy}","received_events_url":"https://api.github.com/users/ibuenros/received_events","type":"User","site_admin":false},"body":"This PR creates a CopyableFile builder to reuse logic in different CopyableDatasets and fixes some bugs with copy operations.","created_at":"2015-12-01T20:52:42Z","updated_at":"2015-12-02T17:57:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74ecb55cf49dd174024dd91b1a30e837f2f44559","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/491/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/491/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/491/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/b636c618ffad17def43f6b79b810e5290e649ab0","head":{"label":"ibuenros:distcp-refactor","ref":"distcp-refactor","sha":"b636c618ffad17def43f6b79b810e5290e649ab0","user":{"login":"ibuenros","id":1364112,"avatar_url":"https://avatars.githubusercontent.com/u/1364112?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuenros","html_url":"https://github.com/ibuenros","followers_url":"https://api.github.com/users/ibuenros/followers","following_url":"https://api.github.com/users/ibuenros/following{/other_user}","gists_url":"https://api.github.com/users/ibuenros/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuenros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuenros/subscriptions","organizations_url":"https://api.github.com/users/ibuenros/orgs","repos_url":"https://api.github.com/users/ibuenros/repos","events_url":"https://api.github.com/users/ibuenros/events{/privacy}","received_events_url":"https://api.github.com/users/ibuenros/received_events","type":"User","site_admin":false},"repo":{"id":33570608,"name":"gobblin","full_name":"ibuenros/gobblin","owner":{"login":"ibuenros","id":1364112,"avatar_url":"https://avatars.githubusercontent.com/u/1364112?v=3","gravatar_id":"","url":"https://api.github.com/users/ibuenros","html_url":"https://github.com/ibuenros","followers_url":"https://api.github.com/users/ibuenros/followers","following_url":"https://api.github.com/users/ibuenros/following{/other_user}","gists_url":"https://api.github.com/users/ibuenros/gists{/gist_id}","starred_url":"https://api.github.com/users/ibuenros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibuenros/subscriptions","organizations_url":"https://api.github.com/users/ibuenros/orgs","repos_url":"https://api.github.com/users/ibuenros/repos","events_url":"https://api.github.com/users/ibuenros/events{/privacy}","received_events_url":"https://api.github.com/users/ibuenros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ibuenros/gobblin","description":"","fork":true,"url":"https://api.github.com/repos/ibuenros/gobblin","forks_url":"https://api.github.com/repos/ibuenros/gobblin/forks","keys_url":"https://api.github.com/repos/ibuenros/gobblin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ibuenros/gobblin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ibuenros/gobblin/teams","hooks_url":"https://api.github.com/repos/ibuenros/gobblin/hooks","issue_events_url":"https://api.github.com/repos/ibuenros/gobblin/issues/events{/number}","events_url":"https://api.github.com/repos/ibuenros/gobblin/events","assignees_url":"https://api.github.com/repos/ibuenros/gobblin/assignees{/user}","branches_url":"https://api.github.com/repos/ibuenros/gobblin/branches{/branch}","tags_url":"https://api.github.com/repos/ibuenros/gobblin/tags","blobs_url":"https://api.github.com/repos/ibuenros/gobblin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ibuenros/gobblin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ibuenros/gobblin/git/refs{/sha}","trees_url":"https://api.github.com/repos/ibuenros/gobblin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ibuenros/gobblin/statuses/{sha}","languages_url":"https://api.github.com/repos/ibuenros/gobblin/languages","stargazers_url":"https://api.github.com/repos/ibuenros/gobblin/stargazers","contributors_url":"https://api.github.com/repos/ibuenros/gobblin/contributors","subscribers_url":"https://api.github.com/repos/ibuenros/gobblin/subscribers","subscription_url":"https://api.github.com/repos/ibuenros/gobblin/subscription","commits_url":"https://api.github.com/repos/ibuenros/gobblin/commits{/sha}","git_commits_url":"https://api.github.com/repos/ibuenros/gobblin/git/commits{/sha}","comments_url":"https://api.github.com/repos/ibuenros/gobblin/comments{/number}","issue_comment_url":"https://api.github.com/repos/ibuenros/gobblin/issues/comments{/number}","contents_url":"https://api.github.com/repos/ibuenros/gobblin/contents/{+path}","compare_url":"https://api.github.com/repos/ibuenros/gobblin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ibuenros/gobblin/merges","archive_url":"https://api.github.com/repos/ibuenros/gobblin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ibuenros/gobblin/downloads","issues_url":"https://api.github.com/repos/ibuenros/gobblin/issues{/number}","pulls_url":"https://api.github.com/repos/ibuenros/gobblin/pulls{/number}","milestones_url":"https://api.github.com/repos/ibuenros/gobblin/milestones{/number}","notifications_url":"https://api.github.com/repos/ibuenros/gobblin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ibuenros/gobblin/labels{/name}","releases_url":"https://api.github.com/repos/ibuenros/gobblin/releases{/id}","created_at":"2015-04-07T22:03:00Z","updated_at":"2015-05-01T22:12:41Z","pushed_at":"2015-12-02T00:10:15Z","git_url":"git://github.com/ibuenros/gobblin.git","ssh_url":"git@github.com:ibuenros/gobblin.git","clone_url":"https://github.com/ibuenros/gobblin.git","svn_url":"https://github.com/ibuenros/gobblin","homepage":null,"size":81208,"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":"1c86406b7a2f86a83542dc7762057d6bdd980cec","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-12-02T16:19:28Z","pushed_at":"2015-12-02T17:55:23Z","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":"https://github.com/linkedin/gobblin/wiki","size":156720,"stargazers_count":314,"watchers_count":314,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":121,"mirror_url":null,"open_issues_count":20,"forks":121,"open_issues":20,"watchers":314,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/491"},"html":{"href":"https://github.com/linkedin/gobblin/pull/491"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/491"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/491/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/491/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/491/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/b636c618ffad17def43f6b79b810e5290e649ab0"}}}}