Cursor execute() { QueryLimits settings = filter.getQueryLimits(); List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : strategies) { iterables.add(s.query(filter, name, definition, values)); } Cursor cursor = Cursors.newPathCursor(Iterables.concat(iterables), settings); if (depth > 1) { cursor = Cursors.newAncestorCursor(cursor, depth - 1, settings); } return cursor; }
@Override public Cursor query(Filter filter, NodeState rootState) { return Cursors.newPathCursor(collector.getResults(filter), filter.getQueryLimits()); }
@Override public Cursor query(Filter filter, NodeState rootState) { return Cursors.newPathCursor(collector.getResults(filter), filter.getQueryLimits()); }
@Override public Cursor query(Filter filter, NodeState rootState) { return Cursors.newPathCursor(collector.getResults(filter), filter.getQueryLimits()); }
Cursor execute() { if (deprecated) { LOG.warn("This index is deprecated: {}; it is used for query {}. " + "Please change the query or the index definitions.", name, filter); } QueryLimits settings = filter.getQueryLimits(); List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : strategies) { iterables.add(s.query(filter, name, definition, values)); } Cursor cursor = Cursors.newPathCursor(Iterables.concat(iterables), settings); if (depth > 1) { cursor = Cursors.newAncestorCursor(cursor, depth - 1, settings); } return cursor; }
Cursor execute() { if (deprecated) { LOG.warn("This index is deprecated: {}; it is used for query {}. " + "Please change the query or the index definitions.", name, filter); } QueryLimits settings = filter.getQueryLimits(); List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : strategies) { iterables.add(s.query(filter, name, definition, values)); } Cursor cursor = Cursors.newPathCursor(Iterables.concat(iterables), settings); if (depth > 1) { cursor = Cursors.newAncestorCursor(cursor, depth - 1, settings); } return cursor; }
private Cursor lookup(NodeState root, String uuid, final String name, String index, Filter filter) { NodeState indexRoot = root.getChildNode(INDEX_DEFINITIONS_NAME) .getChildNode(NAME); if (!indexRoot.exists()) { return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); } List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : getStrategies(indexRoot, mountInfoProvider, index)) { iterables.add(s.query(filter, index + "(" + uuid + ")", indexRoot, ImmutableSet.of(uuid))); } Iterable<String> paths = Iterables.concat(iterables); if (!"*".equals(name)) { paths = filter(paths, new Predicate<String>() { @Override public boolean apply(String path) { return name.equals(getName(path)); } }); } paths = transform(paths, new Function<String, String>() { @Override public String apply(String path) { return getParentPath(path); } }); return newPathCursor(paths, filter.getQueryLimits()); }
private Cursor lookup(NodeState root, String uuid, final String name, String index, Filter filter) { NodeState indexRoot = root.getChildNode(INDEX_DEFINITIONS_NAME) .getChildNode(NAME); if (!indexRoot.exists()) { return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); } List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : getStrategies(indexRoot, mountInfoProvider, index)) { iterables.add(s.query(filter, index + "(" + uuid + ")", indexRoot, ImmutableSet.of(uuid))); } Iterable<String> paths = Iterables.concat(iterables); if (!"*".equals(name)) { paths = filter(paths, new Predicate<String>() { @Override public boolean apply(String path) { return name.equals(getName(path)); } }); } paths = transform(paths, new Function<String, String>() { @Override public String apply(String path) { return getParentPath(path); } }); return newPathCursor(paths, filter.getQueryLimits()); }
private Cursor lookup(NodeState root, String uuid, final String name, String index, Filter filter) { NodeState indexRoot = root.getChildNode(INDEX_DEFINITIONS_NAME) .getChildNode(NAME); if (!indexRoot.exists()) { return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); } List<Iterable<String>> iterables = Lists.newArrayList(); for (IndexStoreStrategy s : getStrategies(indexRoot, mountInfoProvider, index)) { iterables.add(s.query(filter, index + "(" + uuid + ")", indexRoot, ImmutableSet.of(uuid))); } Iterable<String> paths = Iterables.concat(iterables); if (!"*".equals(name)) { paths = filter(paths, new Predicate<String>() { @Override public boolean apply(String path) { return name.equals(getName(path)); } }); } paths = transform(paths, new Function<String, String>() { @Override public String apply(String path) { return getParentPath(path); } }); return newPathCursor(paths, filter.getQueryLimits()); }
@Override public Cursor query(Filter filter, NodeState root) { for (PropertyRestriction pr : filter.getPropertyRestrictions()) { if (isEqualityRestrictionOnType(pr, REFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, REF_NAME, filter); } if (isEqualityRestrictionOnType(pr, WEAKREFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, WEAK_REF_NAME, filter); } } return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); }
@Override public void execute(NodeState rootState) { QueryIndex index = plan.getIndex(); if (index == null) { cursor = Cursors.newPathCursor(new ArrayList<String>(), query.getSettings()); return; } IndexPlan p = plan.getIndexPlan(); if (p != null) { p.setFilter(createFilter(false)); AdvancedQueryIndex adv = (AdvancedQueryIndex) index; cursor = adv.query(p, rootState); } else { cursor = index.query(createFilter(false), rootState); } }
@Override public Cursor query(Filter filter, NodeState root) { for (PropertyRestriction pr : filter.getPropertyRestrictions()) { if (isEqualityRestrictionOnType(pr, REFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, REF_NAME, filter); } if (isEqualityRestrictionOnType(pr, WEAKREFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, WEAK_REF_NAME, filter); } } return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); }
@Override public Cursor query(Filter filter, NodeState root) { for (PropertyRestriction pr : filter.getPropertyRestrictions()) { if (isEqualityRestrictionOnType(pr, REFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, REF_NAME, filter); } if (isEqualityRestrictionOnType(pr, WEAKREFERENCE)) { String uuid = pr.first.getValue(STRING); String name = pr.propertyName; return lookup(root, uuid, name, WEAK_REF_NAME, filter); } } return newPathCursor(new ArrayList<String>(), filter.getQueryLimits()); }
@Override public void execute(NodeState rootState) { QueryIndex index = plan.getIndex(); if (index == null) { cursor = Cursors.newPathCursor(new ArrayList<String>(), query.getSettings()); return; } IndexPlan p = plan.getIndexPlan(); if (p != null) { p.setFilter(createFilter(false)); AdvancedQueryIndex adv = (AdvancedQueryIndex) index; cursor = adv.query(p, rootState); } else { cursor = index.query(createFilter(false), rootState); } }
private void executeInternal(NodeState rootState) { QueryIndex index = plan.getIndex(); timerDuration = null; if (index == null) { cursor = Cursors.newPathCursor(new ArrayList<String>(), query.getSettings()); planIndexName = "traverse"; return; } IndexPlan p = plan.getIndexPlan(); if (p != null) { planIndexName = p.getPlanName(); p.setFilter(createFilter(false)); AdvancedQueryIndex adv = (AdvancedQueryIndex) index; cursor = adv.query(p, rootState); } else { FilterImpl f = createFilter(false); planIndexName = index.getIndexName(f, rootState); cursor = index.query(f, rootState); } }
@Override public Cursor query(Filter filter, NodeState rootState) { Filter.PropertyRestriction pr = filter.getPropertyRestriction("jcr:uuid"); if (pr != null) { NodeBuilder nb = rootState.builder(); //Fake the index type by reverting to "property" for final evaluation nb.child("oak:index").child("uuid").setProperty("type", PropertyIndexEditorProvider.TYPE); rootState = nb.getNodeState(); PropertyIndexLookup pil = new PropertyIndexLookup(rootState); return Cursors.newPathCursor(pil.query(filter, "jcr:uuid", pr.first), new QueryEngineSettings()); } return null; }