@Test public void testInvalidateDirEntries() throws Exception { metadataCache.updateDirEntries("foobar", getDummyDirEntries()); assertEquals(getDummyDirEntries(), metadataCache.getDirEntries("foobar", 0, 100)); metadataCache.invalidateDirEntries("foobar"); assertNull(metadataCache.getDirEntries("foobar", 0, 100)); }
protected void invalidateDirEntries(String path) { if (path.isEmpty() || !enabled) { return; } writeLock.lock(); try { MetadataCacheEntry entry = cache.get(path); if (entry != null) { entry.setDirectoryEntries(null); entry.setDirectoryEntriesTimeoutS(0); } } finally { writeLock.unlock(); } }
MetadataCache { protected void invalidateDirEntries(String path) { if (path.isEmpty() || !enabled) { return; } writeLock.lock(); try { MetadataCacheEntry entry = cache.get(path); if (entry != null) { entry.setDirectoryEntries(null); entry.setDirectoryEntriesTimeoutS(0); } } finally { writeLock.unlock(); } } }
MetadataCache { protected void invalidateDirEntries(String path) { if (path.isEmpty() || !enabled) { return; } writeLock.lock(); try { MetadataCacheEntry entry = cache.get(path); if (entry != null) { entry.setDirectoryEntries(null); entry.setDirectoryEntriesTimeoutS(0); } } finally { writeLock.unlock(); } } protected  MetadataCache(long maxNumberOfEntries, long ttlS); }
MetadataCache { protected void invalidateDirEntries(String path) { if (path.isEmpty() || !enabled) { return; } writeLock.lock(); try { MetadataCacheEntry entry = cache.get(path); if (entry != null) { entry.setDirectoryEntries(null); entry.setDirectoryEntriesTimeoutS(0); } } finally { writeLock.unlock(); } } protected  MetadataCache(long maxNumberOfEntries, long ttlS);  }
MetadataCache { protected void invalidateDirEntries(String path) { if (path.isEmpty() || !enabled) { return; } writeLock.lock(); try { MetadataCacheEntry entry = cache.get(path); if (entry != null) { entry.setDirectoryEntries(null); entry.setDirectoryEntriesTimeoutS(0); } } finally { writeLock.unlock(); } } protected  MetadataCache(long maxNumberOfEntries, long ttlS);   }