{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/50779180","id":50779180,"diff_hunk":"@@ -48,32 +46,48 @@\n  */\n @PublicApi\n @ThreadSafe\n-public class KeyValueOutputFormat extends FileOutputFormat<BytesWritable, BytesWritable> {\n+public final class KeyValueOutputFormat extends FileOutputFormat<BytesWritable, BytesWritable> {\n+  /**\n+   * @param conf MapReduce job configuration\n+   * @return the task's temporary output path ${mapred.out.dir}/_temporary/_${taskid}\n+   */\n+  public static TachyonURI getTaskOutputURI(JobConf conf) {\n+    return getJobOutputURI(conf).join(FileOutputCommitter.TEMP_DIR_NAME).join(\"_\"\n+        + TaskAttemptID.forName(conf.get(\"mapred.task.id\")).toString());\n+  }\n+\n+  /**\n+   * @param conf MapReduce job configuration\n+   * @return the job's output path\n+   */\n+  public static TachyonURI getJobOutputURI(JobConf conf) {\n+    return new TachyonURI(new TachyonURI(FileOutputFormat.getOutputPath(conf).toString())\n+        .getPath());\n+  }\n+\n   @Override\n   public RecordWriter<BytesWritable, BytesWritable> getRecordWriter(FileSystem ignored,\n       JobConf conf, String name, Progressable progress) throws IOException {\n-    Path outputPath = FileOutputFormat.getTaskOutputPath(conf, name);\n-    KeyValueStores kvStore = KeyValueStores.Factory.create();\n-    try {\n-      KeyValueStoreWriter writer = kvStore.create(new TachyonURI(outputPath.toString()));\n-      return new KeyValueRecordWriter(writer, progress);\n-    } catch (TachyonException e) {\n-      throw new IOException(e);\n-    }\n+    return new KeyValueRecordWriter(getTaskOutputURI(conf).join(name), progress);\n   }\n \n   /**\n    * {@inheritDoc}\n    * <p>\n-   * {@link KeyValueOutputCommitter} is forced to be used.\n+   * {@link KeyValueOutputCommitter} is forced to be used. An empty key-value store is created at\n+   * the output path if the path does not exist yet.","path":"keyvalue/clients/src/main/java/tachyon/client/keyvalue/hadoop/KeyValueOutputFormat.java","position":66,"original_position":66,"commit_id":"ae29f305f477a6a267590dfd683b125937348cf4","original_commit_id":"ae29f305f477a6a267590dfd683b125937348cf4","user":{"login":"aaudiber","id":3455177,"avatar_url":"https://avatars.githubusercontent.com/u/3455177?v=3","gravatar_id":"","url":"https://api.github.com/users/aaudiber","html_url":"https://github.com/aaudiber","followers_url":"https://api.github.com/users/aaudiber/followers","following_url":"https://api.github.com/users/aaudiber/following{/other_user}","gists_url":"https://api.github.com/users/aaudiber/gists{/gist_id}","starred_url":"https://api.github.com/users/aaudiber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaudiber/subscriptions","organizations_url":"https://api.github.com/users/aaudiber/orgs","repos_url":"https://api.github.com/users/aaudiber/repos","events_url":"https://api.github.com/users/aaudiber/events{/privacy}","received_events_url":"https://api.github.com/users/aaudiber/received_events","type":"User","site_admin":false},"body":"this makes it sound like nothing happens if the path does exist","created_at":"2016-01-26T00:21:57Z","updated_at":"2016-01-26T00:21:57Z","html_url":"https://github.com/amplab/tachyon/pull/2547#discussion_r50779180","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/2547","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/50779180"},"html":{"href":"https://github.com/amplab/tachyon/pull/2547#discussion_r50779180"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2547"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/2547","id":57007537,"html_url":"https://github.com/amplab/tachyon/pull/2547","diff_url":"https://github.com/amplab/tachyon/pull/2547.diff","patch_url":"https://github.com/amplab/tachyon/pull/2547.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/2547","number":2547,"state":"open","locked":false,"title":"[TACHYON-1619] Add examples to keyvalue package","user":{"login":"uronce-cc","id":3663941,"avatar_url":"https://avatars.githubusercontent.com/u/3663941?v=3","gravatar_id":"","url":"https://api.github.com/users/uronce-cc","html_url":"https://github.com/uronce-cc","followers_url":"https://api.github.com/users/uronce-cc/followers","following_url":"https://api.github.com/users/uronce-cc/following{/other_user}","gists_url":"https://api.github.com/users/uronce-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/uronce-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uronce-cc/subscriptions","organizations_url":"https://api.github.com/users/uronce-cc/orgs","repos_url":"https://api.github.com/users/uronce-cc/repos","events_url":"https://api.github.com/users/uronce-cc/events{/privacy}","received_events_url":"https://api.github.com/users/uronce-cc/received_events","type":"User","site_admin":false},"body":"https://tachyon.atlassian.net/browse/TACHYON-1619\r\n\r\n1. Examples illustrating key-value store native API have been verified.\r\n2. An example mapreduce job cloning a key-value store has been verified on a hadoop1.2.1 cluster.\r\n\r\nThere are also bug fixes in this PR when debugging the above examples.\r\n","created_at":"2016-01-24T16:46:54Z","updated_at":"2016-01-26T00:21:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0804c75cc9057c4cfd869324b61d632ad45775c9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/2547/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/2547/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/2547/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/ae29f305f477a6a267590dfd683b125937348cf4","head":{"label":"uronce-cc:kv-examples","ref":"kv-examples","sha":"ae29f305f477a6a267590dfd683b125937348cf4","user":{"login":"uronce-cc","id":3663941,"avatar_url":"https://avatars.githubusercontent.com/u/3663941?v=3","gravatar_id":"","url":"https://api.github.com/users/uronce-cc","html_url":"https://github.com/uronce-cc","followers_url":"https://api.github.com/users/uronce-cc/followers","following_url":"https://api.github.com/users/uronce-cc/following{/other_user}","gists_url":"https://api.github.com/users/uronce-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/uronce-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uronce-cc/subscriptions","organizations_url":"https://api.github.com/users/uronce-cc/orgs","repos_url":"https://api.github.com/users/uronce-cc/repos","events_url":"https://api.github.com/users/uronce-cc/events{/privacy}","received_events_url":"https://api.github.com/users/uronce-cc/received_events","type":"User","site_admin":false},"repo":{"id":21723448,"name":"tachyon","full_name":"uronce-cc/tachyon","owner":{"login":"uronce-cc","id":3663941,"avatar_url":"https://avatars.githubusercontent.com/u/3663941?v=3","gravatar_id":"","url":"https://api.github.com/users/uronce-cc","html_url":"https://github.com/uronce-cc","followers_url":"https://api.github.com/users/uronce-cc/followers","following_url":"https://api.github.com/users/uronce-cc/following{/other_user}","gists_url":"https://api.github.com/users/uronce-cc/gists{/gist_id}","starred_url":"https://api.github.com/users/uronce-cc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uronce-cc/subscriptions","organizations_url":"https://api.github.com/users/uronce-cc/orgs","repos_url":"https://api.github.com/users/uronce-cc/repos","events_url":"https://api.github.com/users/uronce-cc/events{/privacy}","received_events_url":"https://api.github.com/users/uronce-cc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uronce-cc/tachyon","description":"Memory-centric Storage System for Big Data Analytics","fork":true,"url":"https://api.github.com/repos/uronce-cc/tachyon","forks_url":"https://api.github.com/repos/uronce-cc/tachyon/forks","keys_url":"https://api.github.com/repos/uronce-cc/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uronce-cc/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uronce-cc/tachyon/teams","hooks_url":"https://api.github.com/repos/uronce-cc/tachyon/hooks","issue_events_url":"https://api.github.com/repos/uronce-cc/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/uronce-cc/tachyon/events","assignees_url":"https://api.github.com/repos/uronce-cc/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/uronce-cc/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/uronce-cc/tachyon/tags","blobs_url":"https://api.github.com/repos/uronce-cc/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uronce-cc/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uronce-cc/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/uronce-cc/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uronce-cc/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/uronce-cc/tachyon/languages","stargazers_url":"https://api.github.com/repos/uronce-cc/tachyon/stargazers","contributors_url":"https://api.github.com/repos/uronce-cc/tachyon/contributors","subscribers_url":"https://api.github.com/repos/uronce-cc/tachyon/subscribers","subscription_url":"https://api.github.com/repos/uronce-cc/tachyon/subscription","commits_url":"https://api.github.com/repos/uronce-cc/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/uronce-cc/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/uronce-cc/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/uronce-cc/tachyon/issues/comments{/number}","contents_url":"https://api.github.com/repos/uronce-cc/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/uronce-cc/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uronce-cc/tachyon/merges","archive_url":"https://api.github.com/repos/uronce-cc/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uronce-cc/tachyon/downloads","issues_url":"https://api.github.com/repos/uronce-cc/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/uronce-cc/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/uronce-cc/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/uronce-cc/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uronce-cc/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/uronce-cc/tachyon/releases{/id}","deployments_url":"https://api.github.com/repos/uronce-cc/tachyon/deployments","created_at":"2014-07-11T05:40:12Z","updated_at":"2015-03-24T23:33:22Z","pushed_at":"2016-01-25T23:19:48Z","git_url":"git://github.com/uronce-cc/tachyon.git","ssh_url":"git@github.com:uronce-cc/tachyon.git","clone_url":"https://github.com/uronce-cc/tachyon.git","svn_url":"https://github.com/uronce-cc/tachyon","homepage":"http://tachyon-project.org","size":38800,"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":"amplab:master","ref":"master","sha":"d39e1509df4b77c861dc5f822f301268b19c0e54","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}","deployments_url":"https://api.github.com/repos/amplab/tachyon/deployments","created_at":"2012-12-21T17:43:46Z","updated_at":"2016-01-25T07:33:31Z","pushed_at":"2016-01-26T00:21:38Z","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":46878,"stargazers_count":1922,"watchers_count":1922,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":759,"mirror_url":null,"open_issues_count":18,"forks":759,"open_issues":18,"watchers":1922,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2547"},"html":{"href":"https://github.com/amplab/tachyon/pull/2547"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2547"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/2547/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2547/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/2547/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/ae29f305f477a6a267590dfd683b125937348cf4"}}}}