public interface FileSystemMaster extends Master
LOG
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(AlluxioURI path,
CheckAccessContext context)
Checks access to path.
|
List<AlluxioURI> |
checkConsistency(AlluxioURI path,
CheckConsistencyContext context)
Checks the consistency of the files and directories in the subtree under the path.
|
void |
cleanupUfs()
Periodically clean up the under file systems.
|
void |
completeFile(AlluxioURI path,
CompleteFileContext context)
Completes a file.
|
long |
createDirectory(AlluxioURI path,
CreateDirectoryContext context)
Creates a directory for a given path.
|
FileInfo |
createFile(AlluxioURI path,
CreateFileContext context)
Creates a file (not a directory) for a given path.
|
void |
delete(AlluxioURI path,
DeleteContext context)
Deletes a given path.
|
boolean |
exists(AlluxioURI path,
ExistsContext context)
Checks path exists.
|
void |
free(AlluxioURI path,
FreeContext context)
Frees or evicts all of the blocks of the file from alluxio storage.
|
MountPointInfo |
getDisplayMountPointInfo(AlluxioURI path)
Gets the mount point information of an Alluxio path for display purpose.
|
List<FileBlockInfo> |
getFileBlockInfoList(AlluxioURI path)
Gets the
FileBlockInfo for all blocks of a file. |
long |
getFileId(AlluxioURI path)
Returns the file id for a given path.
|
FileInfo |
getFileInfo(AlluxioURI path,
GetStatusContext context)
Returns the
FileInfo for a given path. |
FileInfo |
getFileInfo(long fileId)
Returns the
FileInfo for a given file id. |
FileSystemMasterView |
getFileSystemMasterView() |
List<AlluxioURI> |
getInAlluxioFiles() |
List<AlluxioURI> |
getInMemoryFiles() |
long |
getInodeCount()
Get the total inode count.
|
Set<Long> |
getLostFiles() |
List<WorkerInfo> |
getLostWorkerList() |
long |
getMountIdFromUfsPath(AlluxioURI ufsPath)
Returns the mount id according to the ufs path.
|
default Map<String,MountPointInfo> |
getMountPointInfoSummary()
This is the same as calling
getMountPointInfoSummary(boolean) with true argument. |
Map<String,MountPointInfo> |
getMountPointInfoSummary(boolean checkUfs) |
long |
getNewBlockIdForFile(AlluxioURI path)
Gets a new block id for the next block of a given file to write to.
|
AlluxioURI |
getPath(long fileId)
Gets the path of a file with the given id.
|
PersistenceState |
getPersistenceState(long fileId)
Returns the persistence state for a file id.
|
Set<Long> |
getPinIdList() |
String |
getRootInodeOwner() |
Scheduler |
getScheduler() |
Collection<String> |
getStateLockSharedWaitersAndHolders() |
List<TimeSeries> |
getTimeSeries() |
String |
getUfsAddress() |
UfsInfo |
getUfsInfo(long mountId) |
List<String> |
getWhiteList() |
List<WorkerInfo> |
getWorkerInfoList() |
List<FileInfo> |
listStatus(AlluxioURI path,
ListStatusContext context)
Returns a list of
FileInfo for a given path. |
void |
listStatus(AlluxioURI path,
ListStatusContext context,
ResultStream<FileInfo> resultStream)
Enumerates given path to given batch tracker.
|
void |
mount(AlluxioURI alluxioPath,
AlluxioURI ufsPath,
MountContext context)
Mounts a UFS path onto an Alluxio path.
|
void |
needsSync(AlluxioURI path)
Mark a path as needed synchronization with the UFS, when this path or any
of its children are accessed, a sync with the UFS will be performed.
|
void |
rename(AlluxioURI srcPath,
AlluxioURI dstPath,
RenameContext context)
Renames a file to a destination.
|
AlluxioURI |
reverseResolve(AlluxioURI ufsUri)
Reverse path resolve a ufs uri to an Alluxio path.
|
void |
scheduleAsyncPersistence(AlluxioURI path,
ScheduleAsyncPersistenceContext context)
Schedules a file for async persistence.
|
void |
setAcl(AlluxioURI path,
SetAclAction action,
List<AclEntry> entries,
SetAclContext context)
Sets the ACL for a path.
|
void |
setAttribute(AlluxioURI path,
SetAttributeContext options)
Sets the file attribute.
|
void |
unmount(AlluxioURI alluxioPath)
Unmounts a UFS path previously mounted onto an Alluxio path.
|
void |
updateMount(AlluxioURI alluxioPath,
MountContext context)
Update properties of an Alluxio mount point.
|
void |
updateUfsMode(AlluxioURI ufsPath,
UfsMode ufsMode)
Update the operation mode for the given ufs path under one or more mount points.
|
FileSystemCommand |
workerHeartbeat(long workerId,
List<Long> persistedFiles,
WorkerHeartbeatContext context)
Instructs a worker to persist the files.
|
createJournalContext, getMasterContext, getStandbyServices
applyAndJournal, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
getCheckpointName, restoreFromCheckpoint, writeToCheckpoint
getJournalEntryIterator
close, getDependencies, getName, getServices, start, stop
void cleanupUfs()
long getFileId(AlluxioURI path) throws AccessControlException, UnavailableException
This operation requires users to have READ permission of the path.
path
- the path to get the file id forAccessControlException
- if permission checking failsUnavailableException
FileInfo getFileInfo(long fileId) throws FileDoesNotExistException, AccessControlException, UnavailableException
FileInfo
for a given file id. This method is not user-facing but supposed
to be called by other internal servers (e.g., block workers, web UI).fileId
- the file id to get the FileInfo
forFileInfo
for the given fileFileDoesNotExistException
- if the file does not existAccessControlException
- if permission deniedUnavailableException
FileInfo getFileInfo(AlluxioURI path, GetStatusContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException, IOException
FileInfo
for a given path.
This operation requires users to have READ permission on the path.
path
- the path to get the FileInfo
forcontext
- the method contextFileInfo
for the given file idFileDoesNotExistException
- if the file does not existInvalidPathException
- if the file path is not validAccessControlException
- if permission checking failsUnavailableException
IOException
long getMountIdFromUfsPath(AlluxioURI ufsPath)
ufsPath
- the ufs pathPersistenceState getPersistenceState(long fileId) throws FileDoesNotExistException
fileId
- the file idPersistenceState
for the given file idFileDoesNotExistException
- if the file does not existList<FileInfo> listStatus(AlluxioURI path, ListStatusContext context) throws AccessControlException, FileDoesNotExistException, InvalidPathException, IOException
FileInfo
for a given path. If the given path is a file, the list only
contains a single object. If it is a directory, the resulting list contains all direct children
of the directory.
This operation requires users to have READ permission on the path, and also EXECUTE permission on the path if it is a directory.
path
- the path to get the FileInfo
list forcontext
- the method contextFileInfo
sAccessControlException
- if permission checking failsFileDoesNotExistException
- if the file does not existInvalidPathException
- if the path is invalidIOException
void listStatus(AlluxioURI path, ListStatusContext context, ResultStream<FileInfo> resultStream) throws AccessControlException, FileDoesNotExistException, InvalidPathException, UnavailableException, IOException
This operation requires users to have READ permission on the path, and also EXECUTE permission on the path if it is a directory.
path
- the path to get the FileInfo
list forcontext
- the method contextresultStream
- the stream to receive individual resultsAccessControlException
- if permission checking failsFileDoesNotExistException
- if the file does not existInvalidPathException
- if the path is invalidUnavailableException
IOException
FileSystemMasterView getFileSystemMasterView()
void checkAccess(AlluxioURI path, CheckAccessContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, IOException
path
- the path to check access tocontext
- the method contextFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the given path is invalidIOException
boolean exists(AlluxioURI path, ExistsContext context) throws AccessControlException, IOException
path
- path to checkcontext
- the method contextAccessControlException
IOException
List<AlluxioURI> checkConsistency(AlluxioURI path, CheckConsistencyContext context) throws AccessControlException, FileDoesNotExistException, InvalidPathException, IOException
path
- the root of the subtree to checkcontext
- the context to use for the checkConsistency methodAccessControlException
- if the permission checking failsFileDoesNotExistException
- if the path does not existInvalidPathException
- if the path is invalidIOException
void completeFile(AlluxioURI path, CompleteFileContext context) throws BlockInfoException, FileDoesNotExistException, InvalidPathException, InvalidFileSizeException, FileAlreadyCompletedException, AccessControlException, UnavailableException
This operation requires users to have WRITE permission on the path.
path
- the file path to completecontext
- the method contextBlockInfoException
- if a block information exception is encounteredFileDoesNotExistException
- if the file does not existInvalidPathException
- if an invalid path is encounteredInvalidFileSizeException
- if an invalid file size is encounteredFileAlreadyCompletedException
- if the file is already completedAccessControlException
- if permission checking failsUnavailableException
FileInfo createFile(AlluxioURI path, CreateFileContext context) throws AccessControlException, InvalidPathException, FileAlreadyExistsException, BlockInfoException, IOException, FileDoesNotExistException
This operation requires WRITE permission on the parent of this path.
path
- the file to createcontext
- the method contextInvalidPathException
- if an invalid path is encounteredFileAlreadyExistsException
- if the file already existsBlockInfoException
- if an invalid block information is encounteredAccessControlException
- if permission checking failsFileDoesNotExistException
- if the parent of the path does not exist and the recursive
option is falseIOException
long getNewBlockIdForFile(AlluxioURI path) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException
This operation requires users to have WRITE permission on the path as this API is called when creating a new block for a file.
path
- the path of the file to get the next block id forFileDoesNotExistException
- if the file does not existInvalidPathException
- if the given path is not validAccessControlException
- if permission checking failsUnavailableException
default Map<String,MountPointInfo> getMountPointInfoSummary()
getMountPointInfoSummary(boolean)
with true argument.MountPointInfo
Map<String,MountPointInfo> getMountPointInfoSummary(boolean checkUfs)
checkUfs
- if true, invoke ufs to set ufs propertiesMountPointInfo
MountPointInfo getDisplayMountPointInfo(AlluxioURI path) throws InvalidPathException
path
- an Alluxio path which must be a mount pointInvalidPathException
void delete(AlluxioURI path, DeleteContext context) throws IOException, FileDoesNotExistException, DirectoryNotEmptyException, InvalidPathException, AccessControlException
This operation requires user to have WRITE permission on the parent of the path.
path
- the path to deletecontext
- method contextDirectoryNotEmptyException
- if recursive is false and the file is a nonempty directoryFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the path is invalidIOException
List<FileBlockInfo> getFileBlockInfoList(AlluxioURI path) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException
FileBlockInfo
for all blocks of a file. If path is a directory, an exception
is thrown.
This operation requires the client user to have READ permission on the the path.
path
- the path to get the info forFileBlockInfo
for all the blocks of the given pathFileDoesNotExistException
- if the file does not exist or path is a directoryInvalidPathException
- if the path of the given file is invalidAccessControlException
- if permission checking failsUnavailableException
List<AlluxioURI> getInAlluxioFiles() throws UnavailableException
UnavailableException
List<AlluxioURI> getInMemoryFiles() throws UnavailableException
UnavailableException
long createDirectory(AlluxioURI path, CreateDirectoryContext context) throws InvalidPathException, FileAlreadyExistsException, IOException, AccessControlException, FileDoesNotExistException
This operation requires the client user to have WRITE permission on the parent of the path.
path
- the path of the directorycontext
- method contextInvalidPathException
- when the path is invalidFileAlreadyExistsException
- when there is already a file at pathAccessControlException
- if permission checking failsFileDoesNotExistException
- if the parent of the path does not exist and the recursive
option is falseIOException
void rename(AlluxioURI srcPath, AlluxioURI dstPath, RenameContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
This operation requires users to have WRITE permission on the parent of the src path, and WRITE permission on the parent of the dst path.
srcPath
- the source path to renamedstPath
- the destination path to rename the file tocontext
- method contextFileDoesNotExistException
- if a non-existent file is encounteredInvalidPathException
- if an invalid path is encounteredAccessControlException
- if permission checking failsFileAlreadyExistsException
- if the file already existsIOException
void free(AlluxioURI path, FreeContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnexpectedAlluxioException, IOException
This operation requires users to have READ permission on the path.
path
- the path to free methodcontext
- context to free methodFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the given path is invalidUnexpectedAlluxioException
- if the file or directory can not be freedIOException
AlluxioURI getPath(long fileId) throws FileDoesNotExistException
fileId
- the id of the file to look upFileDoesNotExistException
- raise if the file does not existString getUfsAddress()
UfsInfo getUfsInfo(long mountId)
mountId
- the mount id to queryvoid mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
This operation requires users to have WRITE permission on the parent of the Alluxio path.
alluxioPath
- the Alluxio path to mount toufsPath
- the UFS path to mountcontext
- the mount contextFileAlreadyExistsException
- if the path to be mounted to already existsFileDoesNotExistException
- if the parent of the path to be mounted to does not existInvalidPathException
- if an invalid path is encounteredAccessControlException
- if the permission check failsIOException
void unmount(AlluxioURI alluxioPath) throws FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
This operation requires users to have WRITE permission on the parent of the Alluxio path.
alluxioPath
- the Alluxio path to unmount, must be a mount pointFileDoesNotExistException
- if the path to be mounted does not existInvalidPathException
- if the given path is not a mount pointAccessControlException
- if the permission check failsIOException
void updateMount(AlluxioURI alluxioPath, MountContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
This operation requires users to have WRITE permission on the parent of the Alluxio path.
alluxioPath
- the Alluxio path to update, must be a mount pointcontext
- the mount contextFileDoesNotExistException
- if the given path does not existInvalidPathException
- if the given path is not a mount pointAccessControlException
- if the permission check failsFileAlreadyExistsException
IOException
void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries, SetAclContext context) throws FileDoesNotExistException, AccessControlException, InvalidPathException, IOException
path
- the path to set attribute foraction
- the set action to performentries
- the list of ACL entries for setting ACLcontext
- the context for setting ACLFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the given path is invalidIOException
void setAttribute(AlluxioURI path, SetAttributeContext options) throws FileDoesNotExistException, AccessControlException, InvalidPathException, IOException
This operation requires users to have WRITE permission on the path. In addition, the client user must be a super user when setting the owner, and must be a super user or the owner when setting the group or permission.
path
- the path to set attribute foroptions
- master operation contextFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the given path is invalidIOException
void scheduleAsyncPersistence(AlluxioURI path, ScheduleAsyncPersistenceContext context) throws AlluxioException, UnavailableException
path
- the path of the file for persistencecontext
- the schedule async persistence contextAlluxioException
UnavailableException
void updateUfsMode(AlluxioURI ufsPath, UfsMode ufsMode) throws InvalidPathException, InvalidArgumentException, UnavailableException, AccessControlException
ufsPath
- the physical ufs pathufsMode
- the ufs operation modeInvalidPathException
- if ufs path is not used by any mount pointInvalidArgumentException
- if arguments for the method are invalidUnavailableException
AccessControlException
FileSystemCommand workerHeartbeat(long workerId, List<Long> persistedFiles, WorkerHeartbeatContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, IOException
Needs WRITE permission on the list of files.
workerId
- the id of the worker that heartbeatspersistedFiles
- the files that persisted on the workercontext
- the method contextFileDoesNotExistException
- if the file does not existInvalidPathException
- if the file path corresponding to the file id is invalidAccessControlException
- if permission checking failsIOException
List<WorkerInfo> getWorkerInfoList() throws UnavailableException
WorkerInfo
objects representing the workers in AlluxioUnavailableException
List<WorkerInfo> getLostWorkerList() throws UnavailableException
WorkerInfo
objects representing the lost workers in AlluxioUnavailableException
long getInodeCount()
List<TimeSeries> getTimeSeries()
AlluxioURI reverseResolve(AlluxioURI ufsUri) throws InvalidPathException
ufsUri
- ufs uriInvalidPathException
String getRootInodeOwner()
Collection<String> getStateLockSharedWaitersAndHolders()
void needsSync(AlluxioURI path) throws InvalidPathException
path
- the path to invalidateInvalidPathException
Scheduler getScheduler()
Copyright © 2023. All Rights Reserved.