public abstract class AbstractUfsManager extends Object implements UfsManager
UfsManager
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractUfsManager.Key
The key of the UFS cache.
|
UfsManager.UfsClient
Modifier and Type | Field and Description |
---|---|
protected com.google.common.io.Closer |
mCloser |
protected ConcurrentHashMap<AbstractUfsManager.Key,UnderFileSystem> |
mUnderFileSystemMap
Maps from key to
UnderFileSystem instances. |
Modifier and Type | Method and Description |
---|---|
void |
addMount(long mountId,
AlluxioURI ufsUri,
UnderFileSystemConfiguration ufsConf)
Keeps track of a mount id and maps it to its URI in Alluxio and configuration.
|
void |
close() |
protected abstract void |
connectUfs(UnderFileSystem fs)
Takes any necessary actions required to establish a connection to the under file system.
|
UfsManager.UfsClient |
get(long mountId)
Gets UFS information from the manager if this mount ID exists, or throws exception otherwise.
|
UfsManager.UfsClient |
getRoot() |
void |
removeMount(long mountId)
Removes the association from a mount id to a UFS instance.
|
protected final ConcurrentHashMap<AbstractUfsManager.Key,UnderFileSystem> mUnderFileSystemMap
UnderFileSystem
instances. This map keeps the entire set of UFS
instances, each keyed by their unique combination of Uri and conf information. This map
helps efficiently identify if a UFS instance in request should be created or can be reused.protected final com.google.common.io.Closer mCloser
protected abstract void connectUfs(UnderFileSystem fs) throws IOException
UnderFileSystem.connectFromMaster(String)
or
UnderFileSystem.connectFromWorker(String)
depending on the running process.IOException
public void addMount(long mountId, AlluxioURI ufsUri, UnderFileSystemConfiguration ufsConf)
UfsManager
addMount
in interface UfsManager
mountId
- the mount idufsUri
- the UFS pathufsConf
- the UFS configurationpublic void removeMount(long mountId)
UfsManager
removeMount
in interface UfsManager
mountId
- the mount idpublic UfsManager.UfsClient get(long mountId) throws NotFoundException, UnavailableException
UfsManager
get
in interface UfsManager
mountId
- the mount idNotFoundException
- if mount id is not found in mount tableUnavailableException
- if master is not available to query for mount tablepublic UfsManager.UfsClient getRoot()
getRoot
in interface UfsManager
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2023. All Rights Reserved.