Search in sources :

Example 1 with PathTracker

use of org.apache.jackrabbit.oak.namepath.PathTracker in project jackrabbit-oak by apache.

the class QueueingHandler method aggregate.

private AggregationResult aggregate(String name, NodeState node, IdentifierTracker childTracker) {
    int aggregationLevel = 0;
    if (aggregator != null) {
        aggregationLevel = aggregator.aggregate(root, parents, new MemoryChildNodeEntry(name, node));
    }
    if (aggregationLevel <= 0) {
        // no aggregation
        return new AggregationResult(name, childTracker, getPrimaryType(node), getMixinTypes(node), pathTracker);
    } else {
        QueueingHandler handler = this;
        IdentifierTracker tracker = childTracker;
        String primaryType = null;
        Iterable<String> mixinTypes = null;
        PathTracker pathTracker = null;
        String childName = null;
        for (int i = 0; i < aggregationLevel; i++) {
            if (i > 0) {
                name = childName + "/" + name;
            }
            tracker = handler.identifierTracker;
            primaryType = handler.parentType;
            mixinTypes = handler.parentMixins;
            pathTracker = handler.pathTracker;
            childName = handler.name;
            handler = handler.parent;
        }
        return new AggregationResult(name, tracker, primaryType, mixinTypes, pathTracker);
    }
}
Also used : PathTracker(org.apache.jackrabbit.oak.namepath.PathTracker) MemoryChildNodeEntry(org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry) IdentifierTracker(org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)

Aggregations

PathTracker (org.apache.jackrabbit.oak.namepath.PathTracker)1 IdentifierTracker (org.apache.jackrabbit.oak.plugins.identifier.IdentifierTracker)1 MemoryChildNodeEntry (org.apache.jackrabbit.oak.plugins.memory.MemoryChildNodeEntry)1