[
https://jira.jboss.org/jira/browse/DNA-466?page=com.atlassian.jira.plugin...
]
Randall Hauch commented on DNA-466:
-----------------------------------
The reason this was done in the first place was because the path of a node can change (as
it or its parents are moved). Ensuring the cached path is difficult to do efficiently.
If the Path is stored on each node, then the paths of all nodes below any moved node
becomes invalid; changing all the cached paths on all nodes in this branch could be
expensive if the cached branch is large. Different means can be used to determine whether
a cached path is still valid (e.g., if ChildPath objects are used, each ChildPath instance
references the Path of it's parent; walk up the ancestors and ensure the ChildPath is
indeed referencing the same Path instance as it's parent), but all those I've
thought of add significant complexity. Plus, although the Paths could be stored in a
Map<UUID,Path>, the NodeInfo objects are already stored in a
Map<UUID,NodeInfo>, and it would be more efficient to cache the Path in the
NodeInfo. But since the Path may change, the NodeInfo could no longer be mutable.
Perhaps the simplest solution is simply a Map<UUID,Path>, and to simply clear this
map every time a node is used. Retrieving a Path for a node would involve a simple map
lookup, and any returned Path could be used as is. If the map contains no Path, then one
would be computed (by walking up the ancestors, checking of course for the existence in
the map of a Path for each ancestor) and added to the map. Although any move would
require recomputing all node paths from scratch, this is not really any worse than what we
have now. And in many ways, it would actually be an improvement as there appears to be
frequently-occurring situations where the Path for a node is retrieved multiple times.
Before I make these changes, I would like to measure the performance of reading all the
nodes in a graph and obtaining each node's path (and perhaps doing this multiple
times). This can be done in the SessionCacheTest. After the path caching is implemented,
the performance should be no worse.
JCR requires connectors to expose UUID as identifier property
-------------------------------------------------------------
Key: DNA-466
URL:
https://jira.jboss.org/jira/browse/DNA-466
Project: DNA
Issue Type: Bug
Components: JCR
Affects Versions: 0.5
Reporter: Randall Hauch
Assignee: Randall Hauch
Priority: Blocker
Fix For: 0.6
The JCR implementation currently expects connectors to return a UUID as the identifier
property. This is obviously incorrect, as it goes against several of the connectors
we've already implemented. In particular, the SessionCache is expecting to find the
UUID, and submits requests to the source with only the UUID (not the path).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira