{"action":"created","comment":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/72050584","id":72050584,"diff_hunk":"@@ -13,75 +13,275 @@\n \n #include \"cache.h\"\n #include \"hash.h\"\n+#include \"kvstore.h\"\n+#include \"statistics.h\"\n #include \"util/pointer.h\"\n \n namespace cache {\n \n+// The null hash (hashed output is all null bytes) serves as a marker for\n+// an invalid handle\n+static const shash::Any kInvalidHandle;\n+\n+static const unsigned kMaxHandles = 8192;\n+\n /**\n- * ...\n- * TODO(jblomer): save open file table for hotpatch\n+ * The @p RamCacheManager class provides a cache backend that operates\n+ * entirely from the host's RAM. This backend does not require any\n+ * additional privileges on the host such as filesystem access.\n+ * This cache resides in a single process' memory, and does not\n+ * support sharing or persistence. This cache backend is a good\n+ * choice in highly restrictive environments, e.g. HPC resources,\n+ * where it is not possible to make use of a shared/local filesystem.\n+ *\n+ * To use this cache backend, set @p CVMFS_CACHE_PRIMARY=ram. There\n+ * are not many knobs to configure; at present only the size to be\n+ * used for cached objects. @p CVMFS_CACHE_RAM_MB sets the cache size\n+ * as an absolute value, while @p CVMFS_CACHE_RAM_PERCENT sets the","path":"cvmfs/cache_ram.h","position":30,"original_position":30,"commit_id":"320bfba6a09a51c1630ad2bdd3905ce1f9ffd764","original_commit_id":"320bfba6a09a51c1630ad2bdd3905ce1f9ffd764","user":{"login":"jblomer","id":1557360,"avatar_url":"https://avatars.githubusercontent.com/u/1557360?v=3","gravatar_id":"","url":"https://api.github.com/users/jblomer","html_url":"https://github.com/jblomer","followers_url":"https://api.github.com/users/jblomer/followers","following_url":"https://api.github.com/users/jblomer/following{/other_user}","gists_url":"https://api.github.com/users/jblomer/gists{/gist_id}","starred_url":"https://api.github.com/users/jblomer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jblomer/subscriptions","organizations_url":"https://api.github.com/users/jblomer/orgs","repos_url":"https://api.github.com/users/jblomer/repos","events_url":"https://api.github.com/users/jblomer/events{/privacy}","received_events_url":"https://api.github.com/users/jblomer/received_events","type":"User","site_admin":false},"body":"Good question... how about using one parameter: `CVMFS_CACHE_RAM_SIZE`? If it ends with a percent sign, it's interpreted accordingly.","created_at":"2016-07-25T11:52:36Z","updated_at":"2016-07-25T11:52:36Z","html_url":"https://github.com/cvmfs/cvmfs/pull/1616#discussion_r72050584","pull_request_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616","_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments/72050584"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/1616#discussion_r72050584"},"pull_request":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616"}}},"pull_request":{"url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616","id":76178940,"html_url":"https://github.com/cvmfs/cvmfs/pull/1616","diff_url":"https://github.com/cvmfs/cvmfs/pull/1616.diff","patch_url":"https://github.com/cvmfs/cvmfs/pull/1616.patch","issue_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/1616","number":1616,"state":"open","locked":false,"title":"Feature ramcache","user":{"login":"trshaffer","id":6613013,"avatar_url":"https://avatars.githubusercontent.com/u/6613013?v=3","gravatar_id":"","url":"https://api.github.com/users/trshaffer","html_url":"https://github.com/trshaffer","followers_url":"https://api.github.com/users/trshaffer/followers","following_url":"https://api.github.com/users/trshaffer/following{/other_user}","gists_url":"https://api.github.com/users/trshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/trshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trshaffer/subscriptions","organizations_url":"https://api.github.com/users/trshaffer/orgs","repos_url":"https://api.github.com/users/trshaffer/repos","events_url":"https://api.github.com/users/trshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/trshaffer/received_events","type":"User","site_admin":false},"body":"Here's a first draft of the RAM cache feature. I put in unit tests to check the core functionality, so I should probably work on gluing it into the FUSE module next. I think more statistics and logging details would also be a good idea.\r\n\r\nLet me know what you think, @jblomer ","created_at":"2016-07-04T15:28:39Z","updated_at":"2016-07-25T11:52:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"312c929aaa1192e6796ee7e222d5dae845b88a2f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616/commits","review_comments_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616/comments","review_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/1616/comments","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/320bfba6a09a51c1630ad2bdd3905ce1f9ffd764","head":{"label":"trshaffer:feature-ramcache","ref":"feature-ramcache","sha":"320bfba6a09a51c1630ad2bdd3905ce1f9ffd764","user":{"login":"trshaffer","id":6613013,"avatar_url":"https://avatars.githubusercontent.com/u/6613013?v=3","gravatar_id":"","url":"https://api.github.com/users/trshaffer","html_url":"https://github.com/trshaffer","followers_url":"https://api.github.com/users/trshaffer/followers","following_url":"https://api.github.com/users/trshaffer/following{/other_user}","gists_url":"https://api.github.com/users/trshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/trshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trshaffer/subscriptions","organizations_url":"https://api.github.com/users/trshaffer/orgs","repos_url":"https://api.github.com/users/trshaffer/repos","events_url":"https://api.github.com/users/trshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/trshaffer/received_events","type":"User","site_admin":false},"repo":{"id":61643580,"name":"cvmfs","full_name":"trshaffer/cvmfs","owner":{"login":"trshaffer","id":6613013,"avatar_url":"https://avatars.githubusercontent.com/u/6613013?v=3","gravatar_id":"","url":"https://api.github.com/users/trshaffer","html_url":"https://github.com/trshaffer","followers_url":"https://api.github.com/users/trshaffer/followers","following_url":"https://api.github.com/users/trshaffer/following{/other_user}","gists_url":"https://api.github.com/users/trshaffer/gists{/gist_id}","starred_url":"https://api.github.com/users/trshaffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trshaffer/subscriptions","organizations_url":"https://api.github.com/users/trshaffer/orgs","repos_url":"https://api.github.com/users/trshaffer/repos","events_url":"https://api.github.com/users/trshaffer/events{/privacy}","received_events_url":"https://api.github.com/users/trshaffer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trshaffer/cvmfs","description":"The CernVM File System","fork":true,"url":"https://api.github.com/repos/trshaffer/cvmfs","forks_url":"https://api.github.com/repos/trshaffer/cvmfs/forks","keys_url":"https://api.github.com/repos/trshaffer/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trshaffer/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trshaffer/cvmfs/teams","hooks_url":"https://api.github.com/repos/trshaffer/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/trshaffer/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/trshaffer/cvmfs/events","assignees_url":"https://api.github.com/repos/trshaffer/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/trshaffer/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/trshaffer/cvmfs/tags","blobs_url":"https://api.github.com/repos/trshaffer/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trshaffer/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trshaffer/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/trshaffer/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trshaffer/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/trshaffer/cvmfs/languages","stargazers_url":"https://api.github.com/repos/trshaffer/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/trshaffer/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/trshaffer/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/trshaffer/cvmfs/subscription","commits_url":"https://api.github.com/repos/trshaffer/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/trshaffer/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/trshaffer/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/trshaffer/cvmfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/trshaffer/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/trshaffer/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trshaffer/cvmfs/merges","archive_url":"https://api.github.com/repos/trshaffer/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trshaffer/cvmfs/downloads","issues_url":"https://api.github.com/repos/trshaffer/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/trshaffer/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/trshaffer/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/trshaffer/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trshaffer/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/trshaffer/cvmfs/releases{/id}","deployments_url":"https://api.github.com/repos/trshaffer/cvmfs/deployments","created_at":"2016-06-21T15:05:15Z","updated_at":"2016-06-21T15:05:19Z","pushed_at":"2016-07-22T14:44:35Z","git_url":"git://github.com/trshaffer/cvmfs.git","ssh_url":"git@github.com:trshaffer/cvmfs.git","clone_url":"https://github.com/trshaffer/cvmfs.git","svn_url":"https://github.com/trshaffer/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":100979,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"cvmfs:devel","ref":"devel","sha":"93719c8c2aaea2028f5f53f01f7268fa8ad55557","user":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"repo":{"id":3784908,"name":"cvmfs","full_name":"cvmfs/cvmfs","owner":{"login":"cvmfs","id":1560859,"avatar_url":"https://avatars.githubusercontent.com/u/1560859?v=3","gravatar_id":"","url":"https://api.github.com/users/cvmfs","html_url":"https://github.com/cvmfs","followers_url":"https://api.github.com/users/cvmfs/followers","following_url":"https://api.github.com/users/cvmfs/following{/other_user}","gists_url":"https://api.github.com/users/cvmfs/gists{/gist_id}","starred_url":"https://api.github.com/users/cvmfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvmfs/subscriptions","organizations_url":"https://api.github.com/users/cvmfs/orgs","repos_url":"https://api.github.com/users/cvmfs/repos","events_url":"https://api.github.com/users/cvmfs/events{/privacy}","received_events_url":"https://api.github.com/users/cvmfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cvmfs/cvmfs","description":"The CernVM File System","fork":false,"url":"https://api.github.com/repos/cvmfs/cvmfs","forks_url":"https://api.github.com/repos/cvmfs/cvmfs/forks","keys_url":"https://api.github.com/repos/cvmfs/cvmfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cvmfs/cvmfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cvmfs/cvmfs/teams","hooks_url":"https://api.github.com/repos/cvmfs/cvmfs/hooks","issue_events_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/events{/number}","events_url":"https://api.github.com/repos/cvmfs/cvmfs/events","assignees_url":"https://api.github.com/repos/cvmfs/cvmfs/assignees{/user}","branches_url":"https://api.github.com/repos/cvmfs/cvmfs/branches{/branch}","tags_url":"https://api.github.com/repos/cvmfs/cvmfs/tags","blobs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cvmfs/cvmfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cvmfs/cvmfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/cvmfs/cvmfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cvmfs/cvmfs/statuses/{sha}","languages_url":"https://api.github.com/repos/cvmfs/cvmfs/languages","stargazers_url":"https://api.github.com/repos/cvmfs/cvmfs/stargazers","contributors_url":"https://api.github.com/repos/cvmfs/cvmfs/contributors","subscribers_url":"https://api.github.com/repos/cvmfs/cvmfs/subscribers","subscription_url":"https://api.github.com/repos/cvmfs/cvmfs/subscription","commits_url":"https://api.github.com/repos/cvmfs/cvmfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/cvmfs/cvmfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/cvmfs/cvmfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/cvmfs/cvmfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/cvmfs/cvmfs/contents/{+path}","compare_url":"https://api.github.com/repos/cvmfs/cvmfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cvmfs/cvmfs/merges","archive_url":"https://api.github.com/repos/cvmfs/cvmfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cvmfs/cvmfs/downloads","issues_url":"https://api.github.com/repos/cvmfs/cvmfs/issues{/number}","pulls_url":"https://api.github.com/repos/cvmfs/cvmfs/pulls{/number}","milestones_url":"https://api.github.com/repos/cvmfs/cvmfs/milestones{/number}","notifications_url":"https://api.github.com/repos/cvmfs/cvmfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cvmfs/cvmfs/labels{/name}","releases_url":"https://api.github.com/repos/cvmfs/cvmfs/releases{/id}","deployments_url":"https://api.github.com/repos/cvmfs/cvmfs/deployments","created_at":"2012-03-21T09:10:41Z","updated_at":"2016-07-07T13:31:36Z","pushed_at":"2016-07-22T15:30:58Z","git_url":"git://github.com/cvmfs/cvmfs.git","ssh_url":"git@github.com:cvmfs/cvmfs.git","clone_url":"https://github.com/cvmfs/cvmfs.git","svn_url":"https://github.com/cvmfs/cvmfs","homepage":"http://cernvm.cern.ch/portal/filesystem","size":108739,"stargazers_count":46,"watchers_count":46,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":10,"forks":47,"open_issues":10,"watchers":46,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616"},"html":{"href":"https://github.com/cvmfs/cvmfs/pull/1616"},"issue":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/1616"},"comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/issues/1616/comments"},"review_comments":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616/comments"},"review_comment":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cvmfs/cvmfs/pulls/1616/commits"},"statuses":{"href":"https://api.github.com/repos/cvmfs/cvmfs/statuses/320bfba6a09a51c1630ad2bdd3905ce1f9ffd764"}}}}
{"actor":{"display_login":"jblomer"}}