@Override public Collection<Mount> getMountsPlacedUnder(String path) { Collection<Mount> mounts = Lists.newArrayList(); for ( Mount mount : this.mounts.values()) { if ( mount.isUnder(path) ) { mounts.add(mount); } } return mounts; }
@Override public Collection<Mount> getMountsPlacedUnder(String path) { Collection<Mount> mounts = Lists.newArrayList(); for ( Mount mount : this.mounts.values()) { if ( mount.isUnder(path) ) { mounts.add(mount); } } return mounts; }
private boolean supportMounts(String path) { return mountInfoProvider .getNonDefaultMounts() .stream() .anyMatch(m -> m.isSupportFragmentUnder(path) || m.isUnder(path)); }
private boolean supportMounts(String path) { return mountInfoProvider .getNonDefaultMounts() .stream() .anyMatch(m -> m.isSupportFragmentUnder(path) || m.isUnder(path)); }
private boolean supportMounts(String path) { return mountInfoProvider .getNonDefaultMounts() .stream() .anyMatch(m -> m.isSupportFragmentUnder(path) || m.isUnder(path)); }
static Set<String> getSupportedPaths(@NotNull ConfigurationParameters params, @NotNull MountInfoProvider mountInfoProvider) { Set<String> supportedPaths = params.getConfigValue(CugConstants.PARAM_CUG_SUPPORTED_PATHS, ImmutableSet.of()); if (!supportedPaths.isEmpty() && mountInfoProvider.hasNonDefaultMounts()) { for (Mount mount : mountInfoProvider.getNonDefaultMounts()) { for (String path : supportedPaths) { if (mount.isUnder(path)) { log.error("Configured supported CUG path '{}' includes node store mount '{}'.", path, mount.getName()); throw new IllegalStateException(); } else if (mount.isMounted(path)) { log.error("Configured supported CUG path '{}' is part of node store mount '{}'.", path, mount.getName()); throw new IllegalStateException(); } } } } return supportedPaths; }
static Set<String> getSupportedPaths(@NotNull ConfigurationParameters params, @NotNull MountInfoProvider mountInfoProvider) { Set<String> supportedPaths = params.getConfigValue(CugConstants.PARAM_CUG_SUPPORTED_PATHS, ImmutableSet.of()); if (!supportedPaths.isEmpty() && mountInfoProvider.hasNonDefaultMounts()) { for (Mount mount : mountInfoProvider.getNonDefaultMounts()) { for (String path : supportedPaths) { if (mount.isUnder(path)) { log.error("Configured supported CUG path '{}' includes node store mount '{}'.", path, mount.getName()); throw new IllegalStateException(); } else if (mount.isMounted(path)) { log.error("Configured supported CUG path '{}' is part of node store mount '{}'.", path, mount.getName()); throw new IllegalStateException(); } } } } return supportedPaths; }
private <T> void visit(Tree tree, MountedNodeStore mountedStore, ErrorHolder errorHolder, T context, MountedNodeStoreChecker<T> c) { // a mounted NodeStore may contain more paths than what it owns, but since these are not accessible // through the CompositeNodeStore skip them Mount mount = mountedStore.getMount(); boolean under = mount.isUnder(tree.getPath()); boolean mounted = mount.isMounted(tree.getPath()); boolean keepGoing = true; if ( mounted ) { keepGoing = c.check(mountedStore, tree, errorHolder, context); } if ( ( mounted || under ) && keepGoing ) { tree.getChildren().forEach( child -> visit(child, mountedStore, errorHolder, context, c)); } }