/** * Load implementation for FileListCacheKey; must return a * ConcurrentHashSet containing the names of all files in this Directory. */ private Object loadIntern() throws IOException { final String[] listAll = directory.listAll(); return new FileListCacheValue(listAll); }
@Override public FileListCacheValue readObject(final ObjectInput input) throws IOException { int size = UnsignedNumeric.readUnsignedInt(input); String[] names = new String[size]; for (int i = 0; i < size; i++) { names[i] = input.readUTF(); } return new FileListCacheValue(names); }
@Override public FileListCacheValue readObject(final ObjectInput input) throws IOException { int size = UnsignedNumeric.readUnsignedInt(input); String[] names = new String[size]; for (int i = 0; i < size; i++) { names[i] = input.readUTF(); } return new FileListCacheValue(names); }
/** * Load implementation for FileListCacheKey; must return a * ConcurrentHashSet containing the names of all files in this Directory. */ private Object loadIntern() throws IOException { final String[] listAll = directory.listAll(); return new FileListCacheValue(listAll); }
/** * @return the current list of files being part of the index */ @GuardedBy("writeLock") private FileListCacheValue getFileList() { FileListCacheValue fileList = (FileListCacheValue) cache.get(fileListCacheKey); if (fileList == null) { fileList = new FileListCacheValue(); FileListCacheValue prev = (FileListCacheValue) cache.putIfAbsent(fileListCacheKey, fileList); if (prev != null) { fileList = prev; } } if (trace) log.trace("Refreshed file listing view"); return fileList; }
/** * @return the current list of files being part of the index */ @GuardedBy("writeLock") private FileListCacheValue getFileList() { FileListCacheValue fileList = (FileListCacheValue) cache.get(fileListCacheKey); if (fileList == null) { fileList = new FileListCacheValue(); FileListCacheValue prev = (FileListCacheValue) cache.putIfAbsent(fileListCacheKey, fileList); if (prev != null) { fileList = prev; } } if (trace) log.trace("Refreshed file listing view"); return fileList; }