{"action":"created","comment":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/41810973","id":41810973,"diff_hunk":"@@ -0,0 +1,206 @@\n+/*\n+ * Copyright (C) 2014-2015 LinkedIn Corp. All rights reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n+ * this file except in compliance with the License. You may obtain a copy of the\n+ * License at  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed\n+ * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied.\n+ */\n+\n+package gobblin.source.extractor.hadoop;\n+\n+import gobblin.configuration.ConfigurationKeys;\n+import gobblin.configuration.SourceState;\n+import gobblin.configuration.State;\n+import gobblin.configuration.WorkUnitState;\n+import gobblin.data.management.copy.CopyableDataset;\n+import gobblin.data.management.copy.CopyableFile;\n+import gobblin.data.management.dataset.Dataset;\n+import gobblin.data.management.dataset.DatasetUtils;\n+import gobblin.data.management.partition.Partition;\n+import gobblin.data.management.partition.PartitionableDataset;\n+import gobblin.data.management.retention.dataset.finder.DatasetFinder;\n+import gobblin.source.extractor.Extractor;\n+import gobblin.source.extractor.extract.AbstractSource;\n+import gobblin.source.workunit.Extract;\n+import gobblin.source.workunit.WorkUnit;\n+import gobblin.util.ForkOperatorUtils;\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.ByteArrayOutputStream;\n+import java.io.DataInputStream;\n+import java.io.DataOutputStream;\n+import java.io.IOException;\n+import java.net.URI;\n+import java.net.URISyntaxException;\n+import java.util.Collection;\n+import java.util.List;\n+\n+import org.apache.commons.codec.DecoderException;\n+import org.apache.commons.codec.binary.Hex;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import com.google.common.collect.Lists;\n+\n+\n+/**\n+ * {@link gobblin.source.Source} that generates work units from {@link gobblin.data.management.copy.CopyableDataset}s.\n+ * Used for doing byte-level copies of files.\n+ */\n+public class CopySource extends AbstractSource<String, byte[]> {","path":"gobblin-core/src/main/java/gobblin/source/extractor/hadoop/CopySource.java","position":57,"original_position":57,"commit_id":"eaeae6fd77c611a0b5afb7086ab0b40aa1375bfb","original_commit_id":"eaeae6fd77c611a0b5afb7086ab0b40aa1375bfb","user":{"login":"chavdar","id":928795,"avatar_url":"https://avatars.githubusercontent.com/u/928795?v=3","gravatar_id":"","url":"https://api.github.com/users/chavdar","html_url":"https://github.com/chavdar","followers_url":"https://api.github.com/users/chavdar/followers","following_url":"https://api.github.com/users/chavdar/following{/other_user}","gists_url":"https://api.github.com/users/chavdar/gists{/gist_id}","starred_url":"https://api.github.com/users/chavdar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavdar/subscriptions","organizations_url":"https://api.github.com/users/chavdar/orgs","repos_url":"https://api.github.com/users/chavdar/repos","events_url":"https://api.github.com/users/chavdar/events{/privacy}","received_events_url":"https://api.github.com/users/chavdar/received_events","type":"User","site_admin":false},"body":"I don't think the record type should be byte[]. I think it should be a custom object that contains:\r\n* An InputStream or FSDataInputStream of the input file. Chances are that the input stream we are reading from is already buffered so we are adding double-buffering overhead. Further, having the InputStream data model will allow us to do some transformation like encrypting/decrypting, compressing/decompressing on-the-fly. I think that FSDataInputStream might be a better fit since it implements Seekable. I think we need that if we want to duplicate input streams (for fork).\r\n* OwnerAndPermission\r\n* Other metadata (e.g. support for extended attributes if we move to a version of hadoop that supports it).\r\n","created_at":"2015-10-12T23:09:13Z","updated_at":"2015-10-12T23:09:13Z","html_url":"https://github.com/linkedin/gobblin/pull/333#discussion_r41810973","pull_request_url":"https://api.github.com/repos/linkedin/gobblin/pulls/333","_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments/41810973"},"html":{"href":"https://github.com/linkedin/gobblin/pull/333#discussion_r41810973"},"pull_request":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/333"}}},"pull_request":{"url":"https://api.github.com/repos/linkedin/gobblin/pulls/333","id":45237832,"html_url":"https://github.com/linkedin/gobblin/pull/333","diff_url":"https://github.com/linkedin/gobblin/pull/333.diff","patch_url":"https://github.com/linkedin/gobblin/pull/333.patch","issue_url":"https://api.github.com/repos/linkedin/gobblin/issues/333","number":333,"state":"open","locked":false,"title":"Simple distcp POC","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":"","created_at":"2015-09-16T23:48:09Z","updated_at":"2015-10-12T23:09:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d07e915ed10ef79895657be5de4852283aa490d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linkedin/gobblin/pulls/333/commits","review_comments_url":"https://api.github.com/repos/linkedin/gobblin/pulls/333/comments","review_comment_url":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linkedin/gobblin/issues/333/comments","statuses_url":"https://api.github.com/repos/linkedin/gobblin/statuses/eaeae6fd77c611a0b5afb7086ab0b40aa1375bfb","head":{"label":"ibuenros:distcp","ref":"distcp","sha":"eaeae6fd77c611a0b5afb7086ab0b40aa1375bfb","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-10-12T20:09:01Z","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":80257,"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":"7aa94d83c69c89221048c398d3ce178f2e9b25cd","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-10-12T11:51:11Z","pushed_at":"2015-10-12T20:08:58Z","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":161810,"stargazers_count":232,"watchers_count":232,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"open_issues_count":5,"forks":73,"open_issues":5,"watchers":232,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/333"},"html":{"href":"https://github.com/linkedin/gobblin/pull/333"},"issue":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/333"},"comments":{"href":"https://api.github.com/repos/linkedin/gobblin/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linkedin/gobblin/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/linkedin/gobblin/statuses/eaeae6fd77c611a0b5afb7086ab0b40aa1375bfb"}}}}