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()); }