@Override public Iterable<String> getChildNodeNames() { return delegate.getChildNodeNames(); }
@NotNull @Override public Iterable<String> getChildNodeNames() { return state.getChildNodeNames(); }
static Set<String> calculateEffectiveIncludePaths(Set<String> includePaths, NodeState sourceRoot) { if (!includePaths.contains("/")) { return copyOf(includePaths); } // include child nodes from source individually to avoid deleting other initialized content final Set<String> includes = newHashSet(); for (String childNodeName : sourceRoot.getChildNodeNames()) { includes.add("/" + childNodeName); } return includes; }
static Set<String> calculateEffectiveIncludePaths(Set<String> includePaths, NodeState sourceRoot) { if (!includePaths.contains("/")) { return copyOf(includePaths); } // include child nodes from source individually to avoid deleting other initialized content final Set<String> includes = newHashSet(); for (String childNodeName : sourceRoot.getChildNodeNames()) { includes.add("/" + childNodeName); } return includes; }
public static Set<IndexStoreStrategy> getStrategies(boolean unique, MountInfoProvider mountInfoProvider, NodeState definition, String defaultName) { Iterable<String> children = definition.getChildNodeNames(); return getStrategies(unique, mountInfoProvider, children, defaultName); }
public static Set<IndexStoreStrategy> getStrategies(boolean unique, MountInfoProvider mountInfoProvider, NodeState definition, String defaultName) { Iterable<String> children = definition.getChildNodeNames(); return getStrategies(unique, mountInfoProvider, children, defaultName); }
public static Set<IndexStoreStrategy> getStrategies(boolean unique, MountInfoProvider mountInfoProvider, NodeState definition, String defaultName) { Iterable<String> children = definition.getChildNodeNames(); return getStrategies(unique, mountInfoProvider, children, defaultName); }
@Override public String toString() { return "OakSolrNodeStateConfiguration{" + "definitionChildren=" + Iterables.toString(definition.getChildNodeNames()) + '}'; }
@NotNull @Override public Iterable<String> checkpoints() { return getCheckpoints().getChildNodeNames(); }
@Nonnull @Override public Iterable<String> getChildNodeNames() { return head().getCurrentNodeState().getChildNodeNames(); }
public static void copyVersionStorage(NodeBuilder targetRoot, NodeState sourceVersionStorage, NodeBuilder targetVersionStorage, VersionCopyConfiguration config) { final Iterator<NodeState> versionStorageIterator = new DescendantsIterator(sourceVersionStorage, 3); final VersionCopier versionCopier = new VersionCopier(targetRoot, sourceVersionStorage, targetVersionStorage); while (versionStorageIterator.hasNext()) { final NodeState versionHistoryBucket = versionStorageIterator.next(); for (String versionHistory : versionHistoryBucket.getChildNodeNames()) { versionCopier.copyVersionHistory(versionHistory, config.getOrphanedMinDate()); } } }
public static void copyVersionStorage(NodeBuilder targetRoot, NodeState sourceVersionStorage, NodeBuilder targetVersionStorage, VersionCopyConfiguration config) { final Iterator<NodeState> versionStorageIterator = new DescendantsIterator(sourceVersionStorage, 3); final VersionCopier versionCopier = new VersionCopier(targetRoot, sourceVersionStorage, targetVersionStorage); while (versionStorageIterator.hasNext()) { final NodeState versionHistoryBucket = versionStorageIterator.next(); for (String versionHistory : versionHistoryBucket.getChildNodeNames()) { versionCopier.copyVersionHistory(versionHistory, config.getOrphanedMinDate()); } } }
@Override public Iterable<? extends ChildNodeEntry> getChildNodeEntries() { return FluentIterable.from(ctx.getContributingStoresForNodes(path, nodeStates)) .transformAndConcat(mns -> FluentIterable .from(nodeStates.get(mns).getChildNodeNames()) .filter(n -> belongsToStore(mns, n))) .transform(n -> new MemoryChildNodeEntry(n, getChildNode(n))); }
private void assertMissingChildNodeName(NodeState decorated, String name) { final Iterable<String> childNodeNames = decorated.getChildNodeNames(); assertFalse("should not list child \"" + name + "\"", Iterables.contains(childNodeNames, name)); } }
private NodeState randomStep(NodeState parent, NodeState node) { int count = (int) node.getChildNodeCount(Long.MAX_VALUE); int k = rnd.nextInt(count + 1); if (k == 0) { return parent; } else { String name = get(node.getChildNodeNames(), k - 1); return node.getChildNode(name); } }
private List<String> getIndexDirNames(String indexName){ NodeState idxDefn = NodeStateUtils.getNode(nodeStore.getRoot(), "/oak:index/"+indexName); List<String> names = new ArrayList<>(); for (String childName : idxDefn.getChildNodeNames()){ if (MultiplexersLucene.isIndexDirName(childName)){ names.add(childName); } } return names; }
@Test public void shouldExposeRecordsNode() { NodeState n = new DataSegmentNode(mockBackend(), "s", mockSegment()); assertTrue(Iterables.contains(n.getChildNodeNames(), "records")); }
private void computeSize(NodeState idxState, LuceneIndexInfo info) throws IOException { LuceneIndexDefinition defn = LuceneIndexDefinition.newBuilder(nodeStore.getRoot(), idxState, info.indexPath).build(); for (String dirName : idxState.getChildNodeNames()) { if (NodeStateUtils.isHidden(dirName) && MultiplexersLucene.isIndexDirName(dirName)) { try (Directory dir = new OakDirectory(new ReadOnlyBuilder(idxState), dirName, defn, true)) { info.numEntries += DirectoryUtils.getNumDocs(dir); info.size = DirectoryUtils.dirSize(dir); } } } }
private void computeSize(NodeState idxState, LuceneIndexInfo info) throws IOException { LuceneIndexDefinition defn = LuceneIndexDefinition.newBuilder(nodeStore.getRoot(), idxState, info.indexPath).build(); for (String dirName : idxState.getChildNodeNames()) { if (NodeStateUtils.isHidden(dirName) && MultiplexersLucene.isIndexDirName(dirName)) { try (Directory dir = new OakDirectory(new ReadOnlyBuilder(idxState), dirName, defn, true)) { info.numEntries += DirectoryUtils.getNumDocs(dir); info.size = DirectoryUtils.dirSize(dir); } } } }
@Test public void hasChildren_BundledRoot_NonBundledChild() throws Exception{ createTestNode("/test/book.jpg", createChild(newNode("app:Asset"), "fooContent").getNodeState()); ds.reset(); assertEquals(1, Iterables.size(getLatestNode("test/book.jpg").getChildNodeNames())); assertEquals(1, ds.queryPaths.size()); assertFalse(hasNodeProperty("/test/book.jpg", META_PROP_BUNDLED_CHILD)); assertTrue(hasNodeProperty("/test/book.jpg", "_children")); }