GitHub PullRequestReviewCommentEvent at 2014-09-05 20:41:06
Repository: tachyon
Actor: dcapwell
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/17196854","id":17196854,"diff_hunk":"@@ -0,0 +1,593 @@\n+package tachyon.worker.hierarchy;\n+\n+import java.io.IOException;\n+import java.nio.ByteBuffer;\n+import java.util.ArrayList;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Set;\n+import java.util.concurrent.ArrayBlockingQueue;\n+import java.util.concurrent.BlockingQueue;\n+import java.util.concurrent.ConcurrentHashMap;\n+\n+import org.apache.log4j.Logger;\n+\n+import com.google.common.collect.HashMultimap;\n+import com.google.common.io.Closer;\n+\n+import tachyon.Constants;\n+import tachyon.UnderFileSystem;\n+import tachyon.client.BlockHandler;\n+import tachyon.util.CommonUtils;\n+import tachyon.worker.WorkerSpaceCounter;\n+\n+/**\n+ * Used to store and manage block files in storage's directory on different under file systems.\n+ */\n+public final class StorageDir {\n+  private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE);\n+  private final Map<Long, Long> mBlockSizes = new ConcurrentHashMap<Long, Long>();\n+  private final Map<Long, Long> mLastBlockAccessTimeMS = new ConcurrentHashMap<Long, Long>();\n+  private final BlockingQueue<Long> mRemovedBlockList = new ArrayBlockingQueue<Long>(\n+      Constants.WORKER_BLOCKS_QUEUE_SIZE);\n+  private final WorkerSpaceCounter mSpaceCounter;\n+  private final long mStorageId;\n+  private final String mDataPath;\n+  private final String mDirPath;\n+  private final String mUserTempPath;\n+  private final UnderFileSystem mUfs;\n+  private final Object mUfsConf;\n+  // Synchronized by itself\n+  private final Map<Long, Long> mUserAllocatedSpace = new HashMap<Long, Long>();\n+  // Synchronized by itself\n+  private final HashMultimap<Long, Long> mLockedBlocksPerUser = HashMultimap.create();","path":"core/src/main/java/tachyon/worker/hierarchy/StorageDir.java","position":44,"original_position":44,"commit_id":"2092ca10259008b6bbbcc739d5cf2a7a62c0f891","original_commit_id":"2092ca10259008b6bbbcc739d5cf2a7a62c0f891","user":{"login":"dcapwell","id":1852601,"avatar_url":"https://avatars.githubusercontent.com/u/1852601?v=2","gravatar_id":"136010620e86ea76cd82ee1f865b5a2e","url":"https://api.github.com/users/dcapwell","html_url":"https://github.com/dcapwell","followers_url":"https://api.github.com/users/dcapwell/followers","following_url":"https://api.github.com/users/dcapwell/following{/other_user}","gists_url":"https://api.github.com/users/dcapwell/gists{/gist_id}","starred_url":"https://api.github.com/users/dcapwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcapwell/subscriptions","organizations_url":"https://api.github.com/users/dcapwell/orgs","repos_url":"https://api.github.com/users/dcapwell/repos","events_url":"https://api.github.com/users/dcapwell/events{/privacy}","received_events_url":"https://api.github.com/users/dcapwell/received_events","type":"User","site_admin":false},"body":"if thats the case, you can get a synchronized mutlimap from MultiMaps","created_at":"2014-09-05T20:41:06Z","updated_at":"2014-09-05T20:41:06Z","html_url":"https://github.com/amplab/tachyon/pull/411#discussion_r17196854","pull_request_url":"https://api.github.com/repos/amplab/tachyon/pulls/411","_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/17196854"},"html":{"href":"https://github.com/amplab/tachyon/pull/411#discussion_r17196854"},"pull_request":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/411"}}},"pull_request":{"url":"https://api.github.com/repos/amplab/tachyon/pulls/411","id":20588913,"html_url":"https://github.com/amplab/tachyon/pull/411","diff_url":"https://github.com/amplab/tachyon/pull/411.diff","patch_url":"https://github.com/amplab/tachyon/pull/411.patch","issue_url":"https://api.github.com/repos/amplab/tachyon/issues/411","number":411,"state":"open","locked":false,"title":"Add storage dir and eviction strategy [TACHYON-33][SubTask 2 & 3]","user":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=2","gravatar_id":null,"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":"resubmitted for PR361, rebase to current master.","created_at":"2014-09-02T01:47:29Z","updated_at":"2014-09-05T20:41:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"028c4776f8edf1666d939c9ab785a4a96d93741b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/amplab/tachyon/pulls/411/commits","review_comments_url":"https://api.github.com/repos/amplab/tachyon/pulls/411/comments","review_comment_url":"https://api.github.com/repos/amplab/tachyon/pulls/comments/{number}","comments_url":"https://api.github.com/repos/amplab/tachyon/issues/411/comments","statuses_url":"https://api.github.com/repos/amplab/tachyon/statuses/2092ca10259008b6bbbcc739d5cf2a7a62c0f891","head":{"label":"shimingfei:AddEvictionStrategy-new","ref":"AddEvictionStrategy-new","sha":"2092ca10259008b6bbbcc739d5cf2a7a62c0f891","user":{"login":"shimingfei","id":2638130,"avatar_url":"https://avatars.githubusercontent.com/u/2638130?v=2","gravatar_id":null,"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=2","gravatar_id":null,"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-06-24T23:54:16Z","pushed_at":"2014-09-05T03:01:26Z","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":7666,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":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":"02c32548774b9003caa9bccc32d0d269e708f124","user":{"login":"amplab","id":1438454,"avatar_url":"https://avatars.githubusercontent.com/u/1438454?v=2","gravatar_id":"c0783723b006eb46526c04fa47ba2cd7","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=2","gravatar_id":"c0783723b006eb46526c04fa47ba2cd7","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":"2014-09-05T08:58:32Z","pushed_at":"2014-09-05T17:40:06Z","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":28233,"stargazers_count":926,"watchers_count":926,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":267,"mirror_url":null,"open_issues_count":14,"forks":267,"open_issues":14,"watchers":926,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/411"},"html":{"href":"https://github.com/amplab/tachyon/pull/411"},"issue":{"href":"https://api.github.com/repos/amplab/tachyon/issues/411"},"comments":{"href":"https://api.github.com/repos/amplab/tachyon/issues/411/comments"},"review_comments":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/411/comments"},"review_comment":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/amplab/tachyon/pulls/411/commits"},"statuses":{"href":"https://api.github.com/repos/amplab/tachyon/statuses/2092ca10259008b6bbbcc739d5cf2a7a62c0f891"}}}}