@ThreadSafe public class FileSystemCache extends Object
FileSystem
clients. This should only be used by the Factory class.Modifier and Type | Class and Description |
---|---|
class |
FileSystemCache.InstanceCachingFileSystem
A wrapper class on a FileSystem instance.
|
static class |
FileSystemCache.Key
A key which can be used to look up a
FileSystem instance in the
FileSystemCache . |
static class |
FileSystemCache.Value
A value wraps a
FileSystem instance and a ref count in the FileSystemCache . |
Constructor and Description |
---|
FileSystemCache()
Constructs a new cache for file system instances.
|
Modifier and Type | Method and Description |
---|---|
FileSystem |
get(FileSystemCache.Key key)
Gets a
FileSystem instance from the cache. |
public FileSystemCache()
public FileSystem get(FileSystemCache.Key key)
FileSystem
instance from the cache. If there is none,
a new instance is created and inserted into the cache.
Note that, the returned instance will be a wrapper of the cached instance which
has its own close state.key
- the key to retrieve a FileSystem
FileSystem
associated with the keyCopyright © 2023. All Rights Reserved.