{"action":"created","comment":{"url":"https://api.github.com/repos/ModeShape/modeshape/pulls/comments/37872127","id":37872127,"diff_hunk":"@@ -144,11 +147,19 @@ public WritableSessionCache( ExecutionContext context,\n         this.referrerChangesForRemovedNodes = new HashMap<NodeKey, ReferrerChanges>();\n         this.binaryReferencesByNodeKey = new ConcurrentHashMap<NodeKey, Set<BinaryKey>>();\n         this.txns = repositoryEnvironment.getTransactions();\n+        this.nodeTypes = repositoryEnvironment.nodeTypes();\n     }\n \n     protected final void assertInSession( SessionNode node ) {\n         assert this.changedNodes.get(node.getKey()) == node : \"Node \" + node.getKey() + \" is not in this session\";\n     }\n+    \n+    protected NodeTypes nodeTypes() {\n+        if (this.nodeTypes == null && workspaceCache().repositoryEnvironment() != null) {\n+            this.nodeTypes = workspaceCache().repositoryEnvironment().nodeTypes();\n+        }  ","path":"modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/WritableSessionCache.java","position":38,"original_position":38,"commit_id":"1695503619dbfa9c804a560dba3f8b16b5487bcd","original_commit_id":"1695503619dbfa9c804a560dba3f8b16b5487bcd","user":{"login":"rhauch","id":84732,"avatar_url":"https://avatars.githubusercontent.com/u/84732?v=3","gravatar_id":"","url":"https://api.github.com/users/rhauch","html_url":"https://github.com/rhauch","followers_url":"https://api.github.com/users/rhauch/followers","following_url":"https://api.github.com/users/rhauch/following{/other_user}","gists_url":"https://api.github.com/users/rhauch/gists{/gist_id}","starred_url":"https://api.github.com/users/rhauch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhauch/subscriptions","organizations_url":"https://api.github.com/users/rhauch/orgs","repos_url":"https://api.github.com/users/rhauch/repos","events_url":"https://api.github.com/users/rhauch/events{/privacy}","received_events_url":"https://api.github.com/users/rhauch/received_events","type":"User","site_admin":false},"body":"This class is `@ThreadSafe` and the `nodeTypes` field is not marked as `volatile`. However, I *think* that might be okay since the actual `NodeTypes` reference returned by `workspaceCache().repositoryEnvironment().nodeTypes()` should always be the same instance. In that case, this logic is idempotent, and its okay for the field to not be `volatile`.","created_at":"2015-08-25T14:34:23Z","updated_at":"2015-08-25T14:34:23Z","html_url":"https://github.com/ModeShape/modeshape/pull/1459#discussion_r37872127","pull_request_url":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459","_links":{"self":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/comments/37872127"},"html":{"href":"https://github.com/ModeShape/modeshape/pull/1459#discussion_r37872127"},"pull_request":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459"}}},"pull_request":{"url":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459","id":43284072,"html_url":"https://github.com/ModeShape/modeshape/pull/1459","diff_url":"https://github.com/ModeShape/modeshape/pull/1459.diff","patch_url":"https://github.com/ModeShape/modeshape/pull/1459.patch","issue_url":"https://api.github.com/repos/ModeShape/modeshape/issues/1459","number":1459,"state":"open","locked":false,"title":"MODE-2109 Adds support for unordered large collections","user":{"login":"hchiorean","id":995683,"avatar_url":"https://avatars.githubusercontent.com/u/995683?v=3","gravatar_id":"","url":"https://api.github.com/users/hchiorean","html_url":"https://github.com/hchiorean","followers_url":"https://api.github.com/users/hchiorean/followers","following_url":"https://api.github.com/users/hchiorean/following{/other_user}","gists_url":"https://api.github.com/users/hchiorean/gists{/gist_id}","starred_url":"https://api.github.com/users/hchiorean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hchiorean/subscriptions","organizations_url":"https://api.github.com/users/hchiorean/orgs","repos_url":"https://api.github.com/users/hchiorean/repos","events_url":"https://api.github.com/users/hchiorean/events{/privacy}","received_events_url":"https://api.github.com/users/hchiorean/received_events","type":"User","site_admin":false},"body":"These are a set of 4 new built-in node types and 1 abstract base type, which store their children into buckets based on the SHA1 of the name of each child. The essential algorithm and different collections types are described [in this comment](https://issues.jboss.org/browse/MODE-2109?focusedCommentId=12928688&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12928688).\r\n\r\nAny JCR operations where the path or name of a child node is known are a lot faster than for regular nodes (e.g. `session.getNode(path)` or `node.getNode(path)`). However, operations where only the ID of node is known - like `node.getPath()` *can be slower* since it requires looking for a node with a certain ID in each of the buckets incrementally. \r\n\r\nThese new node types support large flat hierarchies, but they do have some limitations:\r\n* SNS, ordering, renaming, versioning or federating external sources are not supported\r\n* copying and cloning are only partially supported - i.e. you can copy/clone something into a large collection, but you cannot perform the operation if the source is a large collection\r\n\r\nOther regular JCR operations like querying, import/export etc are supported in similar fashion to regular nodes.","created_at":"2015-08-25T13:16:39Z","updated_at":"2015-08-25T14:34:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"472fc64fb0b682abbac908f4bdd4fa62845c98ef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459/commits","review_comments_url":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459/comments","review_comment_url":"https://api.github.com/repos/ModeShape/modeshape/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ModeShape/modeshape/issues/1459/comments","statuses_url":"https://api.github.com/repos/ModeShape/modeshape/statuses/1695503619dbfa9c804a560dba3f8b16b5487bcd","head":{"label":"hchiorean:MODE-2109","ref":"MODE-2109","sha":"1695503619dbfa9c804a560dba3f8b16b5487bcd","user":{"login":"hchiorean","id":995683,"avatar_url":"https://avatars.githubusercontent.com/u/995683?v=3","gravatar_id":"","url":"https://api.github.com/users/hchiorean","html_url":"https://github.com/hchiorean","followers_url":"https://api.github.com/users/hchiorean/followers","following_url":"https://api.github.com/users/hchiorean/following{/other_user}","gists_url":"https://api.github.com/users/hchiorean/gists{/gist_id}","starred_url":"https://api.github.com/users/hchiorean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hchiorean/subscriptions","organizations_url":"https://api.github.com/users/hchiorean/orgs","repos_url":"https://api.github.com/users/hchiorean/repos","events_url":"https://api.github.com/users/hchiorean/events{/privacy}","received_events_url":"https://api.github.com/users/hchiorean/received_events","type":"User","site_admin":false},"repo":{"id":2686838,"name":"modeshape","full_name":"hchiorean/modeshape","owner":{"login":"hchiorean","id":995683,"avatar_url":"https://avatars.githubusercontent.com/u/995683?v=3","gravatar_id":"","url":"https://api.github.com/users/hchiorean","html_url":"https://github.com/hchiorean","followers_url":"https://api.github.com/users/hchiorean/followers","following_url":"https://api.github.com/users/hchiorean/following{/other_user}","gists_url":"https://api.github.com/users/hchiorean/gists{/gist_id}","starred_url":"https://api.github.com/users/hchiorean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hchiorean/subscriptions","organizations_url":"https://api.github.com/users/hchiorean/orgs","repos_url":"https://api.github.com/users/hchiorean/repos","events_url":"https://api.github.com/users/hchiorean/events{/privacy}","received_events_url":"https://api.github.com/users/hchiorean/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hchiorean/modeshape","description":"ModeShape is a lightweight, fast, pluggable, open-source, federating JCR implementation that can unify content from multiple systems, including files systems, databases, data grids, other repositories, etc.  This is the official source code repository for ModeShape.","fork":true,"url":"https://api.github.com/repos/hchiorean/modeshape","forks_url":"https://api.github.com/repos/hchiorean/modeshape/forks","keys_url":"https://api.github.com/repos/hchiorean/modeshape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hchiorean/modeshape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hchiorean/modeshape/teams","hooks_url":"https://api.github.com/repos/hchiorean/modeshape/hooks","issue_events_url":"https://api.github.com/repos/hchiorean/modeshape/issues/events{/number}","events_url":"https://api.github.com/repos/hchiorean/modeshape/events","assignees_url":"https://api.github.com/repos/hchiorean/modeshape/assignees{/user}","branches_url":"https://api.github.com/repos/hchiorean/modeshape/branches{/branch}","tags_url":"https://api.github.com/repos/hchiorean/modeshape/tags","blobs_url":"https://api.github.com/repos/hchiorean/modeshape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hchiorean/modeshape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hchiorean/modeshape/git/refs{/sha}","trees_url":"https://api.github.com/repos/hchiorean/modeshape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hchiorean/modeshape/statuses/{sha}","languages_url":"https://api.github.com/repos/hchiorean/modeshape/languages","stargazers_url":"https://api.github.com/repos/hchiorean/modeshape/stargazers","contributors_url":"https://api.github.com/repos/hchiorean/modeshape/contributors","subscribers_url":"https://api.github.com/repos/hchiorean/modeshape/subscribers","subscription_url":"https://api.github.com/repos/hchiorean/modeshape/subscription","commits_url":"https://api.github.com/repos/hchiorean/modeshape/commits{/sha}","git_commits_url":"https://api.github.com/repos/hchiorean/modeshape/git/commits{/sha}","comments_url":"https://api.github.com/repos/hchiorean/modeshape/comments{/number}","issue_comment_url":"https://api.github.com/repos/hchiorean/modeshape/issues/comments{/number}","contents_url":"https://api.github.com/repos/hchiorean/modeshape/contents/{+path}","compare_url":"https://api.github.com/repos/hchiorean/modeshape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hchiorean/modeshape/merges","archive_url":"https://api.github.com/repos/hchiorean/modeshape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hchiorean/modeshape/downloads","issues_url":"https://api.github.com/repos/hchiorean/modeshape/issues{/number}","pulls_url":"https://api.github.com/repos/hchiorean/modeshape/pulls{/number}","milestones_url":"https://api.github.com/repos/hchiorean/modeshape/milestones{/number}","notifications_url":"https://api.github.com/repos/hchiorean/modeshape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hchiorean/modeshape/labels{/name}","releases_url":"https://api.github.com/repos/hchiorean/modeshape/releases{/id}","created_at":"2011-11-01T10:30:42Z","updated_at":"2014-07-24T20:12:19Z","pushed_at":"2015-08-25T13:07:52Z","git_url":"git://github.com/hchiorean/modeshape.git","ssh_url":"git@github.com:hchiorean/modeshape.git","clone_url":"https://github.com/hchiorean/modeshape.git","svn_url":"https://github.com/hchiorean/modeshape","homepage":"http://www.modeshape.org","size":123367,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ModeShape:master","ref":"master","sha":"9c2fc988ef9f63abbfb18429edff2aea37294e4e","user":{"login":"ModeShape","id":148023,"avatar_url":"https://avatars.githubusercontent.com/u/148023?v=3","gravatar_id":"","url":"https://api.github.com/users/ModeShape","html_url":"https://github.com/ModeShape","followers_url":"https://api.github.com/users/ModeShape/followers","following_url":"https://api.github.com/users/ModeShape/following{/other_user}","gists_url":"https://api.github.com/users/ModeShape/gists{/gist_id}","starred_url":"https://api.github.com/users/ModeShape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ModeShape/subscriptions","organizations_url":"https://api.github.com/users/ModeShape/orgs","repos_url":"https://api.github.com/users/ModeShape/repos","events_url":"https://api.github.com/users/ModeShape/events{/privacy}","received_events_url":"https://api.github.com/users/ModeShape/received_events","type":"Organization","site_admin":false},"repo":{"id":1244027,"name":"modeshape","full_name":"ModeShape/modeshape","owner":{"login":"ModeShape","id":148023,"avatar_url":"https://avatars.githubusercontent.com/u/148023?v=3","gravatar_id":"","url":"https://api.github.com/users/ModeShape","html_url":"https://github.com/ModeShape","followers_url":"https://api.github.com/users/ModeShape/followers","following_url":"https://api.github.com/users/ModeShape/following{/other_user}","gists_url":"https://api.github.com/users/ModeShape/gists{/gist_id}","starred_url":"https://api.github.com/users/ModeShape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ModeShape/subscriptions","organizations_url":"https://api.github.com/users/ModeShape/orgs","repos_url":"https://api.github.com/users/ModeShape/repos","events_url":"https://api.github.com/users/ModeShape/events{/privacy}","received_events_url":"https://api.github.com/users/ModeShape/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ModeShape/modeshape","description":"ModeShape is a distributed, hierarchical, transactional, and consistent data store with support for queries, full-text search, events, versioning, references, and flexible and dynamic schemas. It is very fast, highly available, extremely scalable, and it is 100% open source and written in Java. Clients use the JSR-283 standard Java API for content repositories (aka, JCR) or ModeShape's REST API, and can query content through JDBC and SQL.","fork":false,"url":"https://api.github.com/repos/ModeShape/modeshape","forks_url":"https://api.github.com/repos/ModeShape/modeshape/forks","keys_url":"https://api.github.com/repos/ModeShape/modeshape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ModeShape/modeshape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ModeShape/modeshape/teams","hooks_url":"https://api.github.com/repos/ModeShape/modeshape/hooks","issue_events_url":"https://api.github.com/repos/ModeShape/modeshape/issues/events{/number}","events_url":"https://api.github.com/repos/ModeShape/modeshape/events","assignees_url":"https://api.github.com/repos/ModeShape/modeshape/assignees{/user}","branches_url":"https://api.github.com/repos/ModeShape/modeshape/branches{/branch}","tags_url":"https://api.github.com/repos/ModeShape/modeshape/tags","blobs_url":"https://api.github.com/repos/ModeShape/modeshape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ModeShape/modeshape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ModeShape/modeshape/git/refs{/sha}","trees_url":"https://api.github.com/repos/ModeShape/modeshape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ModeShape/modeshape/statuses/{sha}","languages_url":"https://api.github.com/repos/ModeShape/modeshape/languages","stargazers_url":"https://api.github.com/repos/ModeShape/modeshape/stargazers","contributors_url":"https://api.github.com/repos/ModeShape/modeshape/contributors","subscribers_url":"https://api.github.com/repos/ModeShape/modeshape/subscribers","subscription_url":"https://api.github.com/repos/ModeShape/modeshape/subscription","commits_url":"https://api.github.com/repos/ModeShape/modeshape/commits{/sha}","git_commits_url":"https://api.github.com/repos/ModeShape/modeshape/git/commits{/sha}","comments_url":"https://api.github.com/repos/ModeShape/modeshape/comments{/number}","issue_comment_url":"https://api.github.com/repos/ModeShape/modeshape/issues/comments{/number}","contents_url":"https://api.github.com/repos/ModeShape/modeshape/contents/{+path}","compare_url":"https://api.github.com/repos/ModeShape/modeshape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ModeShape/modeshape/merges","archive_url":"https://api.github.com/repos/ModeShape/modeshape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ModeShape/modeshape/downloads","issues_url":"https://api.github.com/repos/ModeShape/modeshape/issues{/number}","pulls_url":"https://api.github.com/repos/ModeShape/modeshape/pulls{/number}","milestones_url":"https://api.github.com/repos/ModeShape/modeshape/milestones{/number}","notifications_url":"https://api.github.com/repos/ModeShape/modeshape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ModeShape/modeshape/labels{/name}","releases_url":"https://api.github.com/repos/ModeShape/modeshape/releases{/id}","created_at":"2011-01-12T02:30:46Z","updated_at":"2015-08-23T18:12:41Z","pushed_at":"2015-08-25T13:16:39Z","git_url":"git://github.com/ModeShape/modeshape.git","ssh_url":"git@github.com:ModeShape/modeshape.git","clone_url":"https://github.com/ModeShape/modeshape.git","svn_url":"https://github.com/ModeShape/modeshape","homepage":"http://www.modeshape.org","size":160540,"stargazers_count":142,"watchers_count":142,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":2,"forks":149,"open_issues":2,"watchers":142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459"},"html":{"href":"https://github.com/ModeShape/modeshape/pull/1459"},"issue":{"href":"https://api.github.com/repos/ModeShape/modeshape/issues/1459"},"comments":{"href":"https://api.github.com/repos/ModeShape/modeshape/issues/1459/comments"},"review_comments":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459/comments"},"review_comment":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ModeShape/modeshape/pulls/1459/commits"},"statuses":{"href":"https://api.github.com/repos/ModeShape/modeshape/statuses/1695503619dbfa9c804a560dba3f8b16b5487bcd"}}}}