NodeCache implements Cache<K, V>, GenerationCache, EvictionListener<K, V> { @Override public void invalidateAll(Iterable<?> keys) { memCache.invalidateAll(keys); memCacheMetadata.removeAll(keys); } NodeCache(
            PersistentCache cache,
            Cache<K, V> memCache,
            DocumentNodeStore docNodeStore, 
            DocumentStore docStore,
            CacheType type,
            CacheActionDispatcher dispatcher,
            StatisticsProvider statisticsProvider,
            boolean async); @Override CacheType getType(); @Override void addGeneration(int generation, boolean readOnly); @Override void removeGeneration(int generation); @SuppressWarnings("unchecked") @Override @Nullable V getIfPresent(Object key); @Override V get(K key,
            Callable<? extends V> valueLoader); @Override ImmutableMap<K, V> getAllPresent(
            Iterable<?> keys); @Override void put(K key, V value); @SuppressWarnings("unchecked") @Override void invalidate(Object key); @Override void putAll(Map<? extends K, ? extends V> m); @Override void invalidateAll(Iterable<?> keys); @Override void invalidateAll(); @Override long size(); @Override CacheStats stats(); @Override ConcurrentMap<K, V> asMap(); @Override void cleanUp(); @Override @SuppressWarnings("unchecked") void receive(ByteBuffer buff); @Override void evicted(K key, V value, RemovalCause cause); PersistentCacheStats getPersistentCacheStats();  }
@Test public void persistentCacheAccessForIncludedPathOnly() throws Exception { Path a = Path.fromString("/a"); initializeNodeStore(false, b -> b.setNodeCachePathPredicate( path -> path != null && (a.equals(path) || a.isAncestorOf(path)) )); NodeBuilder builder = ns.getRoot().builder(); builder.child("x"); ns.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY); ns.getNodeCache().invalidateAll(); ns.getNodeChildrenCache().invalidateAll(); MeterStats stats = statsProvider.getMeter("PersistentCache.NodeCache.node.REQUESTS", StatsOptions.DEFAULT); long requests = stats.getCount() + 1; ns.getRoot().hasChildNode("a"); assertEquals(requests, stats.getCount()); ns.getRoot().hasChildNode("b"); assertEquals(requests, stats.getCount()); }