public void run() { cleanup(softLimit); } }
public void run() { if (disabled.get()) return; cleanup(softLimit); } }
public void run() { if (disabled.get()) return; cleanup(softLimit); } }
if (debugCleanup) System.out.println("CleanupTask due to hard limit time=" + new Date().getTime()); // +" Thread="+Thread.currentThread().hashCode() cleanup(hardLimit);
if (debugCleanup) System.out.println("CleanupTask due to hard limit time=" + new Date().getTime()); // +" Thread="+Thread.currentThread().hashCode() cleanup(hardLimit);
private void testPeriodicCleanup(FileCache cache) throws IOException { loadFilesIntoCache(new File(TestDir.cdmLocalTestDataDir), cache); System.out.println(" loaded " + count); // close all Map<Object, FileCache.CacheElement> map = cache.getCache(); List<FileCacheable> files = new ArrayList<>(); for (Object key : map.keySet()) { FileCache.CacheElement elem = map.get(key); assert elem.list.size() == 1; for (FileCache.CacheElement.CacheFile file : elem.list) { files.add(file.ncfile); } } System.out.println(" close " + files.size()); for (FileCacheable ncfile : files) { ncfile.close(); } cache.showCache(new Formatter(System.out)); cache.cleanup(10); }
if (debugCleanup) System.out.println("CleanupTask due to hard limit time=" + new Date().getTime()); // +" Thread="+Thread.currentThread().hashCode() cleanup(hardLimit);