[
https://issues.apache.org/jira/browse/OAK-1048?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13778892#comment-13778892
]
Jukka Zitting commented on OAK-1048:
------------------------------------
Not convinced. If someone changes the definition of something like
oak:primarySubtypes, theyd'd presumably check all cases where
OAK_PRIMARY_SUBTYPES is used, right? Or at least the failing unit tests would
warn about the problem.
If preferred, we can add a utility class that can turn the code to something
like this:
{code}
this.nodeTypeName = getNodeTypeName(nodeType);
this.matchesAllTypes = isNtBase(nodeTypeName);
this.supertypes = newHashSet(getSupertypes(nodeType));
supertypes.add(nodeTypeName);
this.primaryTypes = newHashSet(getPrimarySubtypes(nodeType));
this.mixinTypes = newHashSet(getMixinSubtypes(nodeType));
if (isMixin(nodeType)) {
mixinTypes.add(nodeTypeName);
} else {
primaryTypes.add(nodeTypeName);
}
{code}
... though personally I like the existing constants and direct NodeState
access, as they make it very easy to estimate the performance impact of the
code. Getting something like the list of all primary subtypes through the
standard node type API is orders of magnitude slower.
> Unify node type management in the query index impls
> ---------------------------------------------------
>
> Key: OAK-1048
> URL: https://issues.apache.org/jira/browse/OAK-1048
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: core, query
> Reporter: Alex Parvulescu
> Assignee: Alex Parvulescu
>
> Currently the query index implementations that are node type aware access
> this info directly from the NodeState by reading the child nodes.
> This is fragile (the node type managemet impl may change structure and break
> the tests), and also may hide some access patterns which are node-type
> related behind normal _getChildNode_ calls.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira