@ThreadSafe public final class MountTable extends Object implements DelegatingJournaled
Modifier and Type | Class and Description |
---|---|
class |
MountTable.Resolution
This class represents a UFS path after resolution.
|
class |
MountTable.ReverseResolution
This class represents a Alluxio path after reverse resolution.
|
static class |
MountTable.State
Persistent mount table state.
|
Constructor and Description |
---|
MountTable(UfsManager ufsManager,
MountInfo rootMountInfo)
Creates a new instance of
MountTable . |
Modifier and Type | Method and Description |
---|---|
void |
add(java.util.function.Supplier<JournalContext> journalContext,
AlluxioURI alluxioUri,
AlluxioURI ufsUri,
long mountId,
MountPOptions options)
Mounts the given UFS path at the given Alluxio path.
|
void |
checkUnderWritableMountPoint(AlluxioURI alluxioUri)
Checks to see if a write operation is allowed for the specified Alluxio path, by determining
if it is under a readonly mount point.
|
boolean |
containsMountPoint(AlluxioURI uri,
boolean containsSelf) |
boolean |
delete(java.util.function.Supplier<JournalContext> journalContext,
AlluxioURI uri,
boolean checkNestedMount)
Unmounts the given Alluxio path.
|
Journaled |
getDelegate() |
MountInfo |
getMountInfo(long mountId) |
String |
getMountPoint(AlluxioURI uri)
Returns the closest ancestor mount point the given path is nested under.
|
Map<String,MountInfo> |
getMountTable()
Returns a copy of the current mount table, the mount table is a map from Alluxio file system
URIs to the corresponding mount point information.
|
UfsManager.UfsClient |
getUfsClient(long mountId)
Get the associated ufs client with the mount id.
|
boolean |
isMountPoint(AlluxioURI uri) |
MountTable.Resolution |
resolve(AlluxioURI uri)
Resolves the given Alluxio path.
|
MountTable.ReverseResolution |
reverseResolve(AlluxioURI ufsUri)
Resolves the given Ufs path.
|
void |
update(java.util.function.Supplier<JournalContext> journalContext,
AlluxioURI alluxioUri,
long newMountId,
MountPOptions newOptions)
Update the mount point with new options and mount ID.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyAndJournal, getCheckpointName, getJournalEntryIterator, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
public static final String ROOT
public MountTable(UfsManager ufsManager, MountInfo rootMountInfo)
MountTable
.ufsManager
- the UFS managerrootMountInfo
- root mount infopublic void add(java.util.function.Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, AlluxioURI ufsUri, long mountId, MountPOptions options) throws FileAlreadyExistsException, InvalidPathException
journalContext
- the journal contextalluxioUri
- an Alluxio path URIufsUri
- a UFS path URImountId
- the mount idoptions
- the mount optionsFileAlreadyExistsException
- if the mount point already existsInvalidPathException
- if an invalid path is encounteredpublic boolean delete(java.util.function.Supplier<JournalContext> journalContext, AlluxioURI uri, boolean checkNestedMount)
journalContext
- journal contexturi
- an Alluxio path URIcheckNestedMount
- whether to check nested mount points before deletepublic void update(java.util.function.Supplier<JournalContext> journalContext, AlluxioURI alluxioUri, long newMountId, MountPOptions newOptions) throws InvalidPathException, FileAlreadyExistsException
journalContext
- the journal contextalluxioUri
- an Alluxio path URInewMountId
- the mount idnewOptions
- the mount optionsFileAlreadyExistsException
- if the mount point already existsInvalidPathException
- if an invalid path is encounteredpublic String getMountPoint(AlluxioURI uri) throws InvalidPathException
uri
- an Alluxio path URIInvalidPathException
- if an invalid path is encounteredpublic Map<String,MountInfo> getMountTable()
public boolean containsMountPoint(AlluxioURI uri, boolean containsSelf) throws InvalidPathException
uri
- the Alluxio uri to checkcontainsSelf
- cause method to return true when given uri itself is a mount pointInvalidPathException
public boolean isMountPoint(AlluxioURI uri)
uri
- an Alluxio path URI@Nullable public MountTable.ReverseResolution reverseResolve(AlluxioURI ufsUri)
ufsUri
- an Ufs path URI@Nullable public UfsManager.UfsClient getUfsClient(long mountId)
mountId
- mount id to look up ufs clientpublic MountTable.Resolution resolve(AlluxioURI uri) throws InvalidPathException
uri
- an Alluxio path URIMountTable.Resolution
representing the UFS pathInvalidPathException
- if an invalid path is encounteredpublic void checkUnderWritableMountPoint(AlluxioURI alluxioUri) throws InvalidPathException, AccessControlException
alluxioUri
- an Alluxio path URIInvalidPathException
- if the Alluxio path is invalidAccessControlException
- if the Alluxio path is under a readonly mount point@Nullable public MountInfo getMountInfo(long mountId)
mountId
- the given ufs idpublic Journaled getDelegate()
getDelegate
in interface DelegatingJournaled
Copyright © 2023. All Rights Reserved.