{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/46112394","id":46112394,"diff_hunk":"@@ -0,0 +1,204 @@\n+/*\n+ * Licensed to the University of California, Berkeley under one or more contributor license\n+ * agreements. See the NOTICE file distributed with this work for additional information regarding\n+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n+ * copy of 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 distributed under the License\n+ * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n+ * or implied. See the License for the specific language governing permissions and limitations under\n+ * the License.\n+ */\n+\n+package tachyon.shell.command;\n+\n+import java.io.File;\n+import java.io.FileInputStream;\n+import java.io.IOException;\n+import java.nio.ByteBuffer;\n+import java.nio.channels.FileChannel;\n+import java.util.List;\n+\n+import com.google.common.base.Joiner;\n+import com.google.common.collect.Lists;\n+import com.google.common.io.Closer;\n+\n+import tachyon.Constants;\n+import tachyon.TachyonURI;\n+import tachyon.client.file.FileOutStream;\n+import tachyon.client.file.TachyonFile;\n+import tachyon.client.file.TachyonFileSystem;\n+import tachyon.client.file.options.OutStreamOptions;\n+import tachyon.conf.TachyonConf;\n+import tachyon.exception.ExceptionMessage;\n+import tachyon.exception.FileAlreadyExistsException;\n+import tachyon.exception.TachyonException;\n+import tachyon.shell.TfsShellUtils;\n+import tachyon.thrift.FileInfo;\n+import tachyon.util.io.PathUtils;\n+\n+/**\n+ * Copy the specified file specified by \"source path\" to the path specified by \"remote path\".\n+ * This command will fail if \"remote path\" already exists.\n+ */\n+public class CopyFromLocalCommand extends AbstractTfsShellCommand {\n+\n+  public CopyFromLocalCommand(TachyonConf conf, TachyonFileSystem tfs) {\n+    super(conf, tfs);\n+  }\n+\n+  @Override\n+  public String getCommandName() {\n+    return \"copyFromLocal\";\n+  }\n+\n+  @Override\n+  protected int getNumOfArgs() {\n+    return 2;","path":"shell/src/main/java/tachyon/shell/command/CopyFromLocalCommand.java","position":60,"original_position":60,"commit_id":"686447093cdb05ba20eee20aceb15a8ae808a858","original_commit_id":"c44653bd2a0058ac324a28f1b27ddb4f7f1fe0f0","user":{"login":"yupeng9","id":13425258,"avatar_url":"https://avatars.githubusercontent.com/u/13425258?v=3","gravatar_id":"","url":"https://api.github.com/users/yupeng9","html_url":"https://github.com/yupeng9","followers_url":"https://api.github.com/users/yupeng9/followers","following_url":"https://api.github.com/users/yupeng9/following{/other_user}","gists_url":"https://api.github.com/users/yupeng9/gists{/gist_id}","starred_url":"https://api.github.com/users/yupeng9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yupeng9/subscriptions","organizations_url":"https://api.github.com/users/yupeng9/orgs","repos_url":"https://api.github.com/users/yupeng9/repos","events_url":"https://api.github.com/users/yupeng9/events{/privacy}","received_events_url":"https://api.github.com/users/yupeng9/received_events","type":"User","site_admin":false},"body":"I feel an interface is fine, because it defines the contract that new commands must implement.","created_at":"2015-11-30T06:39:50Z","updated_at":"2015-11-30T06:39:50Z","html_url":"https://github.com/amplab/tachyon/pull/2176#discussion_r46112394","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/2176","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/46112394"},"html":{"href":"https://github.com/amplab/tachyon/pull/2176#discussion_r46112394"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2176"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/2176","id":52057963,"html_url":"https://github.com/amplab/tachyon/pull/2176","diff_url":"https://github.com/amplab/tachyon/pull/2176.diff","patch_url":"https://github.com/amplab/tachyon/pull/2176.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/2176","number":2176,"state":"open","locked":false,"title":"[TACHYON-1328] Reorganize commands in TfsShell","user":{"login":"siyangy","id":15767981,"avatar_url":"https://avatars.githubusercontent.com/u/15767981?v=3","gravatar_id":"","url":"https://api.github.com/users/siyangy","html_url":"https://github.com/siyangy","followers_url":"https://api.github.com/users/siyangy/followers","following_url":"https://api.github.com/users/siyangy/following{/other_user}","gists_url":"https://api.github.com/users/siyangy/gists{/gist_id}","starred_url":"https://api.github.com/users/siyangy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siyangy/subscriptions","organizations_url":"https://api.github.com/users/siyangy/orgs","repos_url":"https://api.github.com/users/siyangy/repos","events_url":"https://api.github.com/users/siyangy/events{/privacy}","received_events_url":"https://api.github.com/users/siyangy/received_events","type":"User","site_admin":false},"body":"https://tachyon.atlassian.net/browse/TACHYON-1328","created_at":"2015-11-29T08:57:28Z","updated_at":"2015-11-30T06:39:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa65cb11eb93496d0e12cfc45078cebe6ff74f91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/2176/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/2176/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/2176/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/686447093cdb05ba20eee20aceb15a8ae808a858","head":{"label":"siyangy:shell","ref":"shell","sha":"686447093cdb05ba20eee20aceb15a8ae808a858","user":{"login":"siyangy","id":15767981,"avatar_url":"https://avatars.githubusercontent.com/u/15767981?v=3","gravatar_id":"","url":"https://api.github.com/users/siyangy","html_url":"https://github.com/siyangy","followers_url":"https://api.github.com/users/siyangy/followers","following_url":"https://api.github.com/users/siyangy/following{/other_user}","gists_url":"https://api.github.com/users/siyangy/gists{/gist_id}","starred_url":"https://api.github.com/users/siyangy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siyangy/subscriptions","organizations_url":"https://api.github.com/users/siyangy/orgs","repos_url":"https://api.github.com/users/siyangy/repos","events_url":"https://api.github.com/users/siyangy/events{/privacy}","received_events_url":"https://api.github.com/users/siyangy/received_events","type":"User","site_admin":false},"repo":{"id":46192489,"name":"tachyon","full_name":"siyangy/tachyon","owner":{"login":"siyangy","id":15767981,"avatar_url":"https://avatars.githubusercontent.com/u/15767981?v=3","gravatar_id":"","url":"https://api.github.com/users/siyangy","html_url":"https://github.com/siyangy","followers_url":"https://api.github.com/users/siyangy/followers","following_url":"https://api.github.com/users/siyangy/following{/other_user}","gists_url":"https://api.github.com/users/siyangy/gists{/gist_id}","starred_url":"https://api.github.com/users/siyangy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siyangy/subscriptions","organizations_url":"https://api.github.com/users/siyangy/orgs","repos_url":"https://api.github.com/users/siyangy/repos","events_url":"https://api.github.com/users/siyangy/events{/privacy}","received_events_url":"https://api.github.com/users/siyangy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/siyangy/tachyon","description":"Memory Centric Reliable Distributed Storage","fork":true,"url":"https://api.github.com/repos/siyangy/tachyon","forks_url":"https://api.github.com/repos/siyangy/tachyon/forks","keys_url":"https://api.github.com/repos/siyangy/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siyangy/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siyangy/tachyon/teams","hooks_url":"https://api.github.com/repos/siyangy/tachyon/hooks","issue_events_url":"https://api.github.com/repos/siyangy/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/siyangy/tachyon/events","assignees_url":"https://api.github.com/repos/siyangy/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/siyangy/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/siyangy/tachyon/tags","blobs_url":"https://api.github.com/repos/siyangy/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siyangy/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siyangy/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/siyangy/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siyangy/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/siyangy/tachyon/languages","stargazers_url":"https://api.github.com/repos/siyangy/tachyon/stargazers","contributors_url":"https://api.github.com/repos/siyangy/tachyon/contributors","subscribers_url":"https://api.github.com/repos/siyangy/tachyon/subscribers","subscription_url":"https://api.github.com/repos/siyangy/tachyon/subscription","commits_url":"https://api.github.com/repos/siyangy/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/siyangy/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/siyangy/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/siyangy/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/siyangy/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/siyangy/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siyangy/tachyon/merges","archive_url":"https://api.github.com/repos/siyangy/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siyangy/tachyon/downloads","issues_url":"https://api.github.com/repos/siyangy/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/siyangy/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/siyangy/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/siyangy/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siyangy/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/siyangy/tachyon/releases{/id}","created_at":"2015-11-14T21:17:36Z","updated_at":"2015-11-14T21:17:43Z","pushed_at":"2015-11-30T06:39:32Z","git_url":"git://github.com/siyangy/tachyon.git","ssh_url":"git@github.com:siyangy/tachyon.git","clone_url":"https://github.com/siyangy/tachyon.git","svn_url":"https://github.com/siyangy/tachyon","homepage":"http://tachyon-project.org","size":31825,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"amplab:master","ref":"master","sha":"81bfe2dc0686734a53a25b319896340608bf83c9","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"repo":{"id":7276954,"name":"tachyon","full_name":"amplab/tachyon","owner":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=3","gravatar_id":"","url":"https://api.github.com/users/amplab","html_url":"https://github.com/amplab","followers_url":"https://api.github.com/users/amplab/followers","following_url":"https://api.github.com/users/amplab/following{/other_user}","gists_url":"https://api.github.com/users/amplab/gists{/gist_id}","starred_url":"https://api.github.com/users/amplab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amplab/subscriptions","organizations_url":"https://api.github.com/users/amplab/orgs","repos_url":"https://api.github.com/users/amplab/repos","events_url":"https://api.github.com/users/amplab/events{/privacy}","received_events_url":"https://api.github.com/users/amplab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amplab/tachyon","description":"Memory Centric Reliable Distributed Storage","fork":false,"url":"https://api.github.com/repos/amplab/tachyon","forks_url":"https://api.github.com/repos/amplab/tachyon/forks","keys_url":"https://api.github.com/repos/amplab/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amplab/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amplab/tachyon/teams","hooks_url":"https://api.github.com/repos/amplab/tachyon/hooks","issue_events_url":"https://api.github.com/repos/amplab/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/amplab/tachyon/events","assignees_url":"https://api.github.com/repos/amplab/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/amplab/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/amplab/tachyon/tags","blobs_url":"https://api.github.com/repos/amplab/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amplab/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amplab/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/amplab/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/amplab/tachyon/languages","stargazers_url":"https://api.github.com/repos/amplab/tachyon/stargazers","contributors_url":"https://api.github.com/repos/amplab/tachyon/contributors","subscribers_url":"https://api.github.com/repos/amplab/tachyon/subscribers","subscription_url":"https://api.github.com/repos/amplab/tachyon/subscription","commits_url":"https://api.github.com/repos/amplab/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/amplab/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/amplab/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/amplab/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/amplab/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/amplab/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amplab/tachyon/merges","archive_url":"https://api.github.com/repos/amplab/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amplab/tachyon/downloads","issues_url":"https://api.github.com/repos/amplab/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/amplab/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/amplab/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/amplab/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amplab/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/amplab/tachyon/releases{/id}","created_at":"2012-12-21T17:43:46Z","updated_at":"2015-11-29T18:12:06Z","pushed_at":"2015-11-30T06:39:32Z","git_url":"git://github.com/amplab/tachyon.git","ssh_url":"git@github.com:amplab/tachyon.git","clone_url":"https://github.com/amplab/tachyon.git","svn_url":"https://github.com/amplab/tachyon","homepage":"http://tachyon-project.org","size":39982,"stargazers_count":1766,"watchers_count":1766,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":697,"mirror_url":null,"open_issues_count":30,"forks":697,"open_issues":30,"watchers":1766,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2176"},"html":{"href":"https://github.com/amplab/tachyon/pull/2176"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2176"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2176/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2176/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2176/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/686447093cdb05ba20eee20aceb15a8ae808a858"}}}}