@NotThreadSafe public class DefaultFileSystemMaster extends CoreMaster implements FileSystemMaster, DelegatingJournaled
Modifier and Type | Class and Description |
---|---|
static class |
DefaultFileSystemMaster.Metrics
Class that contains metrics for FileSystemMaster.
|
Modifier and Type | Field and Description |
---|---|
protected AsyncUserAccessAuditLogWriter |
mAsyncAuditLogWriter
Log writer for user access audit log.
|
protected InodeTree |
mInodeTree
This manages the file system inode structure.
|
int |
mRecursiveOperationForceFlushEntries |
protected CallTracker |
mStateLockCallTracker
Used to check pending/running backup from RPCs.
|
mBackupManager, mJournalSystem, mPort, mPrimarySelector, mSafeModeManager, mStartTimeMs
mJournal, mMasterContext
Constructor and Description |
---|
DefaultFileSystemMaster(BlockMaster blockMaster,
CoreMasterContext masterContext)
Creates a new instance of
DefaultFileSystemMaster . |
DefaultFileSystemMaster(BlockMaster blockMaster,
CoreMasterContext masterContext,
ExecutorServiceFactory executorServiceFactory,
java.time.Clock clock)
Creates a new instance of
DefaultFileSystemMaster . |
Modifier and Type | Method and Description |
---|---|
void |
activeSyncMetadata(AlluxioURI path,
Collection<AlluxioURI> changedFiles,
ExecutorService executorService)
Actively sync metadata, based on a list of changed files.
|
protected boolean |
areDescendantsLoaded(InodeDirectoryView inode) |
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 |
close()
Closes the server.
|
void |
completeFile(AlluxioURI path,
CompleteFileContext context)
Completes a file.
|
protected FileSystemMasterAuditContext |
createAuditContext(String command,
AlluxioURI srcPath,
AlluxioURI dstPath,
Inode srcInode)
Creates a
FileSystemMasterAuditContext instance. |
protected BlockDeletionContext |
createBlockDeletionContext() |
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.
|
JournalContext |
createJournalContext() |
RpcContext |
createRpcContext() |
RpcContext |
createRpcContext(OperationContext operationContext) |
protected LockingScheme |
createSyncLockingScheme(AlluxioURI path,
FileSystemMasterCommonPOptions options,
DescendantType descendantType) |
void |
delete(AlluxioURI path,
DeleteContext context)
Deletes a given path.
|
void |
deleteInternal(RpcContext rpcContext,
LockedInodePath inodePath,
DeleteContext deleteContext,
boolean bypassPermCheck)
Implements file deletion.
|
protected void |
ensureFullPathAndUpdateCache(LockedInodePath inodePath)
Checks to see if the entire path exists in Alluxio.
|
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.
|
Journaled |
getDelegate() |
Set<Class<? extends Server>> |
getDependencies() |
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() |
long |
getMountIdFromUfsPath(AlluxioURI ufsPath)
Returns the mount id according to the ufs path.
|
Map<String,MountPointInfo> |
getMountPointInfoSummary(boolean checkUfs) |
MountTable |
getMountTable() |
String |
getName() |
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()
Get scheduler.
|
Map<ServiceType,GrpcService> |
getServices() |
Collection<String> |
getStateLockSharedWaitersAndHolders() |
UfsSyncPathCache |
getSyncPathCache() |
List<SyncPointInfo> |
getSyncPathList() |
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.
|
protected void |
loadMetadataIfNotExist(RpcContext rpcContext,
AlluxioURI path,
LoadMetadataContext context)
Loads metadata for the path if it is (non-existing || load direct children is set).
|
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.
|
boolean |
recordActiveSyncTxid(long txId,
long mountId)
Journal the active sync transaction id so that we can restart more efficiently.
|
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 context)
Sets the file attribute.
|
protected void |
setAttributeSingleFile(RpcContext rpcContext,
LockedInodePath inodePath,
boolean updateUfs,
long opTimeMs,
SetAttributeContext context) |
void |
start(Boolean isPrimary)
Starts the Alluxio server.
|
void |
startSync(AlluxioURI syncPoint)
starts active sync on a specified alluxioURI.
|
void |
stop()
Stops the Alluxio server.
|
void |
stopSync(AlluxioURI syncPoint)
stops active sync on a specific syncpoint.
|
void |
unmount(AlluxioURI alluxioPath)
Unmounts a UFS path previously mounted onto an Alluxio path.
|
protected void |
updateAccessTime(RpcContext rpcContext,
Inode inode,
long opTimeMs) |
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.
|
void |
validateInodeBlocks(boolean repair)
Checks the integrity of the inodes with respect to the blocks of the system.
|
FileSystemCommand |
workerHeartbeat(long workerId,
List<Long> persistedFiles,
WorkerHeartbeatContext context)
Instructs a worker to persist the files.
|
getExecutorService, getMasterContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMountPointInfoSummary
getMasterContext, getStandbyServices
applyAndJournal, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
getCheckpointName
getJournalEntryIterator
applyAndJournal, getCheckpointName, getJournalEntryIterator, processJournalEntry, resetState, restoreFromCheckpoint, writeToCheckpoint
protected final InodeTree mInodeTree
protected AsyncUserAccessAuditLogWriter mAsyncAuditLogWriter
protected final CallTracker mStateLockCallTracker
public final int mRecursiveOperationForceFlushEntries
public DefaultFileSystemMaster(BlockMaster blockMaster, CoreMasterContext masterContext)
DefaultFileSystemMaster
.blockMaster
- a block master handlemasterContext
- the context for Alluxio masterpublic DefaultFileSystemMaster(BlockMaster blockMaster, CoreMasterContext masterContext, ExecutorServiceFactory executorServiceFactory, java.time.Clock clock)
DefaultFileSystemMaster
.blockMaster
- a block master handlemasterContext
- the context for Alluxio masterexecutorServiceFactory
- a factory for creating the executor service to use for running
maintenance threadsclock
- the clock used to compute the current timepublic Map<ServiceType,GrpcService> getServices()
getServices
in interface Server<Boolean>
public String getName()
public Set<Class<? extends Server>> getDependencies()
getDependencies
in interface Server<Boolean>
getDependencies
in class AbstractMaster
public Journaled getDelegate()
getDelegate
in interface DelegatingJournaled
public JournalContext createJournalContext() throws UnavailableException
createJournalContext
in interface Master
createJournalContext
in class AbstractMaster
UnavailableException
public void start(Boolean isPrimary) throws IOException
Server
start
in interface Server<Boolean>
start
in class AbstractMaster
isPrimary
- the start optionsIOException
public void stop() throws IOException
Server
#start(T)
should be
cleaned up and shutdown.stop
in interface Server<Boolean>
stop
in class AbstractMaster
IOException
public void close() throws IOException
Server
close
in interface Server<Boolean>
close
in class AbstractMaster
IOException
public void validateInodeBlocks(boolean repair) throws UnavailableException
FileSystemMaster
validateInodeBlocks
in interface FileSystemMaster
repair
- if true, will attempt to repair the state of the system when inconsistencies are
discoveredUnavailableException
- if the repair attempt failspublic void cleanupUfs()
FileSystemMaster
cleanupUfs
in interface FileSystemMaster
public long getFileId(AlluxioURI path) throws AccessControlException, UnavailableException
FileSystemMaster
This operation requires users to have READ permission of the path.
getFileId
in interface FileSystemMaster
path
- the path to get the file id forAccessControlException
- if permission checking failsUnavailableException
public FileInfo getFileInfo(long fileId) throws FileDoesNotExistException, AccessControlException, UnavailableException
FileSystemMaster
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).getFileInfo
in interface FileSystemMaster
fileId
- the file id to get the FileInfo
forFileInfo
for the given fileFileDoesNotExistException
- if the file does not existAccessControlException
- if permission deniedUnavailableException
public FileInfo getFileInfo(AlluxioURI path, GetStatusContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, IOException
FileSystemMaster
FileInfo
for a given path.
This operation requires users to have READ permission on the path.
getFileInfo
in interface FileSystemMaster
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 failsIOException
public long getMountIdFromUfsPath(AlluxioURI ufsPath)
FileSystemMaster
getMountIdFromUfsPath
in interface FileSystemMaster
ufsPath
- the ufs pathpublic PersistenceState getPersistenceState(long fileId) throws FileDoesNotExistException
FileSystemMaster
getPersistenceState
in interface FileSystemMaster
fileId
- the file idPersistenceState
for the given file idFileDoesNotExistException
- if the file does not existpublic void listStatus(AlluxioURI path, ListStatusContext context, ResultStream<FileInfo> resultStream) throws AccessControlException, FileDoesNotExistException, InvalidPathException, IOException
FileSystemMaster
This operation requires users to have READ permission on the path, and also EXECUTE permission on the path if it is a directory.
listStatus
in interface FileSystemMaster
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 invalidIOException
public List<FileInfo> listStatus(AlluxioURI path, ListStatusContext context) throws AccessControlException, FileDoesNotExistException, InvalidPathException, IOException
FileSystemMaster
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.
listStatus
in interface FileSystemMaster
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
protected boolean areDescendantsLoaded(InodeDirectoryView inode)
protected void ensureFullPathAndUpdateCache(LockedInodePath inodePath) throws InvalidPathException, FileDoesNotExistException
inodePath
- the path to ensureInvalidPathException
FileDoesNotExistException
public FileSystemMasterView getFileSystemMasterView()
getFileSystemMasterView
in interface FileSystemMaster
public void checkAccess(AlluxioURI path, CheckAccessContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, IOException
FileSystemMaster
checkAccess
in interface FileSystemMaster
path
- the path to check access tocontext
- the method contextFileDoesNotExistException
- if the file does not existInvalidPathException
- if the given path is invalidAccessControlException
- if permission checking failsIOException
public List<AlluxioURI> checkConsistency(AlluxioURI path, CheckConsistencyContext context) throws AccessControlException, FileDoesNotExistException, InvalidPathException, IOException
FileSystemMaster
checkConsistency
in interface FileSystemMaster
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
public boolean exists(AlluxioURI path, ExistsContext context) throws AccessControlException, IOException
FileSystemMaster
exists
in interface FileSystemMaster
path
- path to checkcontext
- the method contextAccessControlException
IOException
public void completeFile(AlluxioURI path, CompleteFileContext context) throws BlockInfoException, FileDoesNotExistException, InvalidPathException, InvalidFileSizeException, FileAlreadyCompletedException, AccessControlException, UnavailableException
FileSystemMaster
This operation requires users to have WRITE permission on the path.
completeFile
in interface FileSystemMaster
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
public FileInfo createFile(AlluxioURI path, CreateFileContext context) throws AccessControlException, InvalidPathException, FileAlreadyExistsException, BlockInfoException, IOException, FileDoesNotExistException
FileSystemMaster
This operation requires WRITE permission on the parent of this path.
createFile
in interface FileSystemMaster
path
- the file to createcontext
- the method contextAccessControlException
- if permission checking failsInvalidPathException
- if an invalid path is encounteredFileAlreadyExistsException
- if the file already existsBlockInfoException
- if an invalid block information is encounteredFileDoesNotExistException
- if the parent of the path does not exist and the recursive
option is falseIOException
public long getNewBlockIdForFile(AlluxioURI path) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException
FileSystemMaster
This operation requires users to have WRITE permission on the path as this API is called when creating a new block for a file.
getNewBlockIdForFile
in interface FileSystemMaster
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
public Map<String,MountPointInfo> getMountPointInfoSummary(boolean checkUfs)
getMountPointInfoSummary
in interface FileSystemMaster
checkUfs
- if true, invoke ufs to set ufs propertiesMountPointInfo
public MountPointInfo getDisplayMountPointInfo(AlluxioURI path) throws InvalidPathException
FileSystemMaster
getDisplayMountPointInfo
in interface FileSystemMaster
path
- an Alluxio path which must be a mount pointInvalidPathException
public void delete(AlluxioURI path, DeleteContext context) throws IOException, FileDoesNotExistException, DirectoryNotEmptyException, InvalidPathException, AccessControlException
FileSystemMaster
This operation requires user to have WRITE permission on the parent of the path.
delete
in interface FileSystemMaster
path
- the path to deletecontext
- method contextFileDoesNotExistException
- if the file does not existDirectoryNotEmptyException
- if recursive is false and the file is a nonempty directoryInvalidPathException
- if the path is invalidAccessControlException
- if permission checking failsIOException
public void deleteInternal(RpcContext rpcContext, LockedInodePath inodePath, DeleteContext deleteContext, boolean bypassPermCheck) throws FileDoesNotExistException, IOException, DirectoryNotEmptyException, InvalidPathException
This method does not delete blocks. Instead, it returns deleted inodes so that their blocks can be deleted after the inode deletion journal entry has been written. We cannot delete blocks earlier because the inode deletion may fail, leaving us with inode containing deleted blocks. This method is used at: (1) delete() (2) unmount() (3) metadata sync (when a file/dir has been removed in UFS) Permission check should be skipped in (2) and (3).
rpcContext
- the rpc contextinodePath
- the file LockedInodePath
deleteContext
- the method optitionsbypassPermCheck
- whether the permission check has been done before entering this callFileDoesNotExistException
IOException
DirectoryNotEmptyException
InvalidPathException
public List<FileBlockInfo> getFileBlockInfoList(AlluxioURI path) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException
FileSystemMaster
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.
getFileBlockInfoList
in interface FileSystemMaster
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
public List<AlluxioURI> getInAlluxioFiles() throws UnavailableException
getInAlluxioFiles
in interface FileSystemMaster
UnavailableException
public List<AlluxioURI> getInMemoryFiles() throws UnavailableException
getInMemoryFiles
in interface FileSystemMaster
UnavailableException
public long createDirectory(AlluxioURI path, CreateDirectoryContext context) throws InvalidPathException, FileAlreadyExistsException, IOException, AccessControlException, FileDoesNotExistException
FileSystemMaster
This operation requires the client user to have WRITE permission on the parent of the path.
createDirectory
in interface FileSystemMaster
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
public void rename(AlluxioURI srcPath, AlluxioURI dstPath, RenameContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
FileSystemMaster
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.
rename
in interface FileSystemMaster
srcPath
- the source path to renamedstPath
- the destination path to rename the file tocontext
- method contextFileAlreadyExistsException
- if the file already existsFileDoesNotExistException
- if a non-existent file is encounteredInvalidPathException
- if an invalid path is encounteredAccessControlException
- if permission checking failsIOException
public void free(AlluxioURI path, FreeContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnexpectedAlluxioException, IOException
FileSystemMaster
This operation requires users to have READ permission on the path.
free
in interface FileSystemMaster
path
- the path to free methodcontext
- context to free methodFileDoesNotExistException
- if the file does not existInvalidPathException
- if the given path is invalidAccessControlException
- if permission checking failsUnexpectedAlluxioException
- if the file or directory can not be freedIOException
public AlluxioURI getPath(long fileId) throws FileDoesNotExistException
FileSystemMaster
getPath
in interface FileSystemMaster
fileId
- the id of the file to look upFileDoesNotExistException
- raise if the file does not existpublic Set<Long> getPinIdList()
getPinIdList
in interface FileSystemMaster
public String getUfsAddress()
getUfsAddress
in interface FileSystemMaster
public UfsInfo getUfsInfo(long mountId)
getUfsInfo
in interface FileSystemMaster
mountId
- the mount id to querypublic List<String> getWhiteList()
getWhiteList
in interface FileSystemMaster
public Set<Long> getLostFiles()
getLostFiles
in interface FileSystemMaster
protected void loadMetadataIfNotExist(RpcContext rpcContext, AlluxioURI path, LoadMetadataContext context) throws InvalidPathException, AccessControlException
shouldLoadMetadataIfNotExists(LockedInodePath, LoadMetadataContext)
.rpcContext
- the rpc contextpath
- the path to load metadata forcontext
- the LoadMetadataContext
InvalidPathException
AccessControlException
public void updateMount(AlluxioURI alluxioPath, MountContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
FileSystemMaster
This operation requires users to have WRITE permission on the parent of the Alluxio path.
updateMount
in interface FileSystemMaster
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
public void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountContext context) throws FileAlreadyExistsException, FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
FileSystemMaster
This operation requires users to have WRITE permission on the parent of the Alluxio path.
mount
in interface FileSystemMaster
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
public void unmount(AlluxioURI alluxioPath) throws FileDoesNotExistException, InvalidPathException, IOException, AccessControlException
FileSystemMaster
This operation requires users to have WRITE permission on the parent of the Alluxio path.
unmount
in interface FileSystemMaster
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
public void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries, SetAclContext context) throws FileDoesNotExistException, AccessControlException, InvalidPathException, IOException
FileSystemMaster
setAcl
in interface FileSystemMaster
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
public void setAttribute(AlluxioURI path, SetAttributeContext context) throws FileDoesNotExistException, AccessControlException, InvalidPathException, IOException
FileSystemMaster
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.
setAttribute
in interface FileSystemMaster
path
- the path to set attribute forcontext
- master operation contextFileDoesNotExistException
- if the file does not existAccessControlException
- if permission checking failsInvalidPathException
- if the given path is invalidIOException
public void scheduleAsyncPersistence(AlluxioURI path, ScheduleAsyncPersistenceContext context) throws AlluxioException, UnavailableException
FileSystemMaster
scheduleAsyncPersistence
in interface FileSystemMaster
path
- the path of the file for persistencecontext
- the schedule async persistence contextAlluxioException
UnavailableException
public void activeSyncMetadata(AlluxioURI path, @Nullable Collection<AlluxioURI> changedFiles, ExecutorService executorService) throws IOException
activeSyncMetadata
in interface FileSystemMaster
path
- the path to syncchangedFiles
- collection of files that are changed under the path to full sync if this is
null, force sync the entire directory. if this is not null but an empty collection,
this method does nothing.executorService
- executor to execute the parallel incremental syncIOException
public boolean recordActiveSyncTxid(long txId, long mountId)
FileSystemMaster
recordActiveSyncTxid
in interface FileSystemMaster
txId
- transaction idmountId
- mount idpublic FileSystemCommand workerHeartbeat(long workerId, List<Long> persistedFiles, WorkerHeartbeatContext context) throws IOException
FileSystemMaster
Needs WRITE permission on the list of files.
workerHeartbeat
in interface FileSystemMaster
workerId
- the id of the worker that heartbeatspersistedFiles
- the files that persisted on the workercontext
- the method contextIOException
protected void setAttributeSingleFile(RpcContext rpcContext, LockedInodePath inodePath, boolean updateUfs, long opTimeMs, SetAttributeContext context) throws FileDoesNotExistException, InvalidPathException, AccessControlException
inodePath
- the LockedInodePath
to useupdateUfs
- whether to update the UFS with the attribute changeopTimeMs
- the operation time (in milliseconds)context
- the method contextFileDoesNotExistException
InvalidPathException
AccessControlException
public List<SyncPointInfo> getSyncPathList()
getSyncPathList
in interface FileSystemMaster
public void startSync(AlluxioURI syncPoint) throws IOException, InvalidPathException, AccessControlException, ConnectionFailedException
FileSystemMaster
startSync
in interface FileSystemMaster
syncPoint
- sync point which is a valid path in Alluxio namespaceUnavailableException
InvalidPathException
AccessControlException
IOException
ConnectionFailedException
public void stopSync(AlluxioURI syncPoint) throws IOException, InvalidPathException, AccessControlException
FileSystemMaster
stopSync
in interface FileSystemMaster
syncPoint
- alluxio path that has been added as a sync pointUnavailableException
InvalidPathException
AccessControlException
IOException
public List<WorkerInfo> getWorkerInfoList() throws UnavailableException
getWorkerInfoList
in interface FileSystemMaster
WorkerInfo
objects representing the workers in AlluxioUnavailableException
public long getInodeCount()
FileSystemMaster
getInodeCount
in interface FileSystemMaster
public void updateUfsMode(AlluxioURI ufsPath, UfsMode ufsMode) throws InvalidPathException, InvalidArgumentException, UnavailableException, AccessControlException
FileSystemMaster
updateUfsMode
in interface FileSystemMaster
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
protected FileSystemMasterAuditContext createAuditContext(String command, AlluxioURI srcPath, @Nullable AlluxioURI dstPath, @Nullable Inode srcInode)
FileSystemMasterAuditContext
instance.command
- the command to be logged by this AuditContext
srcPath
- the source path of this commanddstPath
- the destination path of this commandsrcInode
- the source inode of this commandFileSystemMasterAuditContext
instanceprotected BlockDeletionContext createBlockDeletionContext()
public RpcContext createRpcContext() throws UnavailableException
UnavailableException
public RpcContext createRpcContext(OperationContext operationContext) throws UnavailableException
operationContext
- the operation contextUnavailableException
protected LockingScheme createSyncLockingScheme(AlluxioURI path, FileSystemMasterCommonPOptions options, DescendantType descendantType) throws InvalidPathException
InvalidPathException
protected void updateAccessTime(RpcContext rpcContext, Inode inode, long opTimeMs)
public List<TimeSeries> getTimeSeries()
getTimeSeries
in interface FileSystemMaster
public AlluxioURI reverseResolve(AlluxioURI ufsUri) throws InvalidPathException
FileSystemMaster
reverseResolve
in interface FileSystemMaster
ufsUri
- ufs uriInvalidPathException
@Nullable public String getRootInodeOwner()
getRootInodeOwner
in interface FileSystemMaster
public Collection<String> getStateLockSharedWaitersAndHolders()
getStateLockSharedWaitersAndHolders
in interface FileSystemMaster
public UfsSyncPathCache getSyncPathCache()
public MountTable getMountTable()
public void needsSync(AlluxioURI path) throws InvalidPathException
FileSystemMaster
needsSync
in interface FileSystemMaster
path
- the path to invalidateInvalidPathException
public Scheduler getScheduler()
Copyright © 2023. All Rights Reserved.