public class LRUFilesCache extends AbstractFilesCache
LRUMap.
The default constructor uses a LRU size of 100 per filesystem.
| Constructor and Description |
|---|
LRUFilesCache()
Default constructor.
|
LRUFilesCache(int lruSize)
Set the desired LRU size.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(FileSystem filesystem)
Purges the entries corresponding to the FileSystem.
|
void |
close()
Closes the provider.
|
FileObject |
getFile(FileSystem filesystem,
FileName name)
Retrieves a FileObject from the cache by name.
|
protected Map<FileName,FileObject> |
getOrCreateFilesystemCache(FileSystem filesystem) |
void |
putFile(FileObject file)
Adds a FileObject to the cache.
|
boolean |
putFileIfAbsent(FileObject file)
Adds a FileObject to the cache if it isn't already present.
|
void |
removeFile(FileSystem filesystem,
FileName name)
Removes a file from cache.
|
void |
touchFile(FileObject file) |
getContext, getLogger, init, setContext, setLoggerpublic LRUFilesCache()
public LRUFilesCache(int lruSize)
lruSize - the LRU sizepublic void putFile(FileObject file)
FilesCachefile - the filepublic boolean putFileIfAbsent(FileObject file)
FilesCachefile - the filepublic FileObject getFile(FileSystem filesystem, FileName name)
FilesCachefilesystem - The FileSystem.name - the namepublic void clear(FileSystem filesystem)
FilesCachefilesystem - The FileSystem.protected Map<FileName,FileObject> getOrCreateFilesystemCache(FileSystem filesystem)
public void close()
AbstractVfsComponentclose in interface FilesCacheclose in interface VfsComponentclose in class AbstractVfsComponentpublic void removeFile(FileSystem filesystem, FileName name)
FilesCachefilesystem - filesystemname - filenamepublic void touchFile(FileObject file)
touchFile in class AbstractFilesCacheCopyright © 2002–2016 The Apache Software Foundation. All rights reserved.