{"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/23898179","id":23898179,"diff_hunk":"@@ -0,0 +1,44 @@\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.worker.allocation;\n+\n+import tachyon.worker.hierarchy.StorageDir;\n+\n+/**\n+ * Allocate space on StorageDirs by round robin\n+ */\n+public class AllocateRR extends AllocateStrategyBase {\n+  int mDirIndex = 0;\n+\n+  @Override\n+  public synchronized StorageDir getStorageDir(StorageDir[] storageDirs, long userId,\n+      long requestSizeBytes) {\n+    StorageDir availableDir = null;\n+    for (int j = 0; j < storageDirs.length; mDirIndex ++, j ++) {\n+      if (mDirIndex == storageDirs.length) {\n+        mDirIndex = 0;\n+      }\n+      if (storageDirs[mDirIndex].getAvailableBytes() >= requestSizeBytes) {\n+        availableDir = storageDirs[mDirIndex];\n+        mDirIndex ++;\n+        if (availableDir.requestSpace(userId, requestSizeBytes)) {\n+          break;","path":"core/src/main/java/tachyon/worker/allocation/AllocateRR.java","position":38,"original_position":38,"commit_id":"39f2071320f06bf81c7705a895e3b70a407bd416","original_commit_id":"dd1bf58604bb996e8ab50662989aa04fe9ec171f","user":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=3","gravatar_id":"","url":"https://api.github.com/users/shimingfei","html_url":"https://github.com/shimingfei","followers_url":"https://api.github.com/users/shimingfei/followers","following_url":"https://api.github.com/users/shimingfei/following{/other_user}","gists_url":"https://api.github.com/users/shimingfei/gists{/gist_id}","starred_url":"https://api.github.com/users/shimingfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimingfei/subscriptions","organizations_url":"https://api.github.com/users/shimingfei/orgs","repos_url":"https://api.github.com/users/shimingfei/repos","events_url":"https://api.github.com/users/shimingfei/events{/privacy}","received_events_url":"https://api.github.com/users/shimingfei/received_events","type":"User","site_admin":false},"body":"yes, it is a bug, I will fix it.","created_at":"2015-02-01T15:16:14Z","updated_at":"2015-02-01T15:16:14Z","html_url":"https://github.com/amplab/tachyon/pull/590#discussion_r23898179","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/590","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/23898179"},"html":{"href":"https://github.com/amplab/tachyon/pull/590#discussion_r23898179"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/590"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/590","id":26572583,"html_url":"https://github.com/amplab/tachyon/pull/590","diff_url":"https://github.com/amplab/tachyon/pull/590.diff","patch_url":"https://github.com/amplab/tachyon/pull/590.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/590","number":590,"state":"open","locked":false,"title":"Resubmit \"Merge hierarchy store into Tachyon [TACHYON-33 sub-task 5 & 6]\"","user":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=3","gravatar_id":"","url":"https://api.github.com/users/shimingfei","html_url":"https://github.com/shimingfei","followers_url":"https://api.github.com/users/shimingfei/followers","following_url":"https://api.github.com/users/shimingfei/following{/other_user}","gists_url":"https://api.github.com/users/shimingfei/gists{/gist_id}","starred_url":"https://api.github.com/users/shimingfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimingfei/subscriptions","organizations_url":"https://api.github.com/users/shimingfei/orgs","repos_url":"https://api.github.com/users/shimingfei/repos","events_url":"https://api.github.com/users/shimingfei/events{/privacy}","received_events_url":"https://api.github.com/users/shimingfei/received_events","type":"User","site_admin":false},"body":"resubmit the PR\r\nMerge hierarchy store into Tachyon, which supports storing data on both memory and other storage(SSD HDD etc), client side and RPC interface are also modified accordingly\r\nJIRA:\r\nhttps://tachyon.atlassian.net/browse/TACHYON-38\r\nhttps://tachyon.atlassian.net/browse/TACHYON-39\r\n\r\nold PR:https://github.com/amplab/tachyon/pull/532\r\n","created_at":"2014-12-25T03:03:33Z","updated_at":"2015-02-01T15:16:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cbf8de28ac94d23120171252f9e9878a17d9d82","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/590/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/590/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/590/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/39f2071320f06bf81c7705a895e3b70a407bd416","head":{"label":"shimingfei:MergeHierarchyStore-resubmit","ref":"MergeHierarchyStore-resubmit","sha":"39f2071320f06bf81c7705a895e3b70a407bd416","user":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=3","gravatar_id":"","url":"https://api.github.com/users/shimingfei","html_url":"https://github.com/shimingfei","followers_url":"https://api.github.com/users/shimingfei/followers","following_url":"https://api.github.com/users/shimingfei/following{/other_user}","gists_url":"https://api.github.com/users/shimingfei/gists{/gist_id}","starred_url":"https://api.github.com/users/shimingfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimingfei/subscriptions","organizations_url":"https://api.github.com/users/shimingfei/orgs","repos_url":"https://api.github.com/users/shimingfei/repos","events_url":"https://api.github.com/users/shimingfei/events{/privacy}","received_events_url":"https://api.github.com/users/shimingfei/received_events","type":"User","site_admin":false},"repo":{"id":20919861,"name":"tachyon","full_name":"shimingfei/tachyon","owner":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=3","gravatar_id":"","url":"https://api.github.com/users/shimingfei","html_url":"https://github.com/shimingfei","followers_url":"https://api.github.com/users/shimingfei/followers","following_url":"https://api.github.com/users/shimingfei/following{/other_user}","gists_url":"https://api.github.com/users/shimingfei/gists{/gist_id}","starred_url":"https://api.github.com/users/shimingfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimingfei/subscriptions","organizations_url":"https://api.github.com/users/shimingfei/orgs","repos_url":"https://api.github.com/users/shimingfei/repos","events_url":"https://api.github.com/users/shimingfei/events{/privacy}","received_events_url":"https://api.github.com/users/shimingfei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shimingfei/tachyon","description":"Memory-centric Storage System for Big Data Analytics","fork":true,"url":"https://api.github.com/repos/shimingfei/tachyon","forks_url":"https://api.github.com/repos/shimingfei/tachyon/forks","keys_url":"https://api.github.com/repos/shimingfei/tachyon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shimingfei/tachyon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shimingfei/tachyon/teams","hooks_url":"https://api.github.com/repos/shimingfei/tachyon/hooks","issue_events_url":"https://api.github.com/repos/shimingfei/tachyon/issues/events{/number}","events_url":"https://api.github.com/repos/shimingfei/tachyon/events","assignees_url":"https://api.github.com/repos/shimingfei/tachyon/assignees{/user}","branches_url":"https://api.github.com/repos/shimingfei/tachyon/branches{/branch}","tags_url":"https://api.github.com/repos/shimingfei/tachyon/tags","blobs_url":"https://api.github.com/repos/shimingfei/tachyon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shimingfei/tachyon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shimingfei/tachyon/git/refs{/sha}","trees_url":"https://api.github.com/repos/shimingfei/tachyon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shimingfei/tachyon/statuses/{sha}","languages_url":"https://api.github.com/repos/shimingfei/tachyon/languages","stargazers_url":"https://api.github.com/repos/shimingfei/tachyon/stargazers","contributors_url":"https://api.github.com/repos/shimingfei/tachyon/contributors","subscribers_url":"https://api.github.com/repos/shimingfei/tachyon/subscribers","subscription_url":"https://api.github.com/repos/shimingfei/tachyon/subscription","commits_url":"https://api.github.com/repos/shimingfei/tachyon/commits{/sha}","git_commits_url":"https://api.github.com/repos/shimingfei/tachyon/git/commits{/sha}","comments_url":"https://api.github.com/repos/shimingfei/tachyon/comments{/number}","issue_comment_url":"https://api.github.com/repos/shimingfei/tachyon/issues/comments/{number}","contents_url":"https://api.github.com/repos/shimingfei/tachyon/contents/{+path}","compare_url":"https://api.github.com/repos/shimingfei/tachyon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shimingfei/tachyon/merges","archive_url":"https://api.github.com/repos/shimingfei/tachyon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shimingfei/tachyon/downloads","issues_url":"https://api.github.com/repos/shimingfei/tachyon/issues{/number}","pulls_url":"https://api.github.com/repos/shimingfei/tachyon/pulls{/number}","milestones_url":"https://api.github.com/repos/shimingfei/tachyon/milestones{/number}","notifications_url":"https://api.github.com/repos/shimingfei/tachyon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shimingfei/tachyon/labels{/name}","releases_url":"https://api.github.com/repos/shimingfei/tachyon/releases{/id}","created_at":"2014-06-17T10:50:29Z","updated_at":"2014-11-22T07:35:35Z","pushed_at":"2015-02-01T06:10:06Z","git_url":"git://github.com/shimingfei/tachyon.git","ssh_url":"git@github.com:shimingfei/tachyon.git","clone_url":"https://github.com/shimingfei/tachyon.git","svn_url":"https://github.com/shimingfei/tachyon","homepage":"http://tachyon-project.org","size":9920,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"amplab:master","ref":"master","sha":"81d7ace3f7aca9444e7f59fb86cca83a2cd2fa37","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":" A Reliable Memory Centric Distributed Storage System","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-01-31T21:24:54Z","pushed_at":"2015-01-31T18:02:37Z","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":22435,"stargazers_count":1153,"watchers_count":1153,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":395,"mirror_url":null,"open_issues_count":22,"forks":395,"open_issues":22,"watchers":1153,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/590"},"html":{"href":"https://github.com/amplab/tachyon/pull/590"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/590"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/590/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/590/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/590/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/39f2071320f06bf81c7705a895e3b70a407bd416"}}}}