public class DelegatingFileSystem extends java.lang.Object implements FileSystem
FileSystem.Factory| Modifier and Type | Field and Description |
|---|---|
protected FileSystem |
mDelegatedFileSystem |
| Constructor and Description |
|---|
DelegatingFileSystem(FileSystem fs)
Wraps a file system instance to forward messages.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkAccess(AlluxioURI path,
CheckAccessPOptions options)
Checks access to a path.
|
void |
close() |
void |
createDirectory(AlluxioURI path,
CreateDirectoryPOptions options)
Creates a directory.
|
FileOutStream |
createFile(AlluxioURI path,
CreateFilePOptions options)
Creates a file.
|
void |
delete(AlluxioURI path,
DeletePOptions options)
Deletes a file or a directory.
|
boolean |
exists(AlluxioURI path,
ExistsPOptions options)
Checks whether a path exists in Alluxio space.
|
void |
free(AlluxioURI path,
FreePOptions options)
Evicts any data under the given path from Alluxio space, but does not delete the data from the
UFS.
|
java.util.List<BlockLocationInfo> |
getBlockLocations(AlluxioURI path)
Builds a list of
BlockLocationInfo for the given file. |
java.util.List<BlockLocationInfo> |
getBlockLocations(URIStatus status)
Builds a list of
BlockLocationInfo for the given file. |
AlluxioConfiguration |
getConf() |
java.util.Map<java.lang.String,MountPointInfo> |
getMountTable(boolean checkUfs)
Lists all mount points and their corresponding under storage addresses.
|
URIStatus |
getStatus(AlluxioURI path,
GetStatusPOptions options)
Gets the
URIStatus object that represents the metadata of an Alluxio path. |
java.util.List<SyncPointInfo> |
getSyncPathList()
Lists all the actively synced paths.
|
boolean |
isClosed()
If there are operations currently running and close is called concurrently the behavior is
undefined.
|
void |
iterateStatus(AlluxioURI path,
ListStatusPOptions options,
java.util.function.Consumer<? super URIStatus> action)
Performs a specific action on each
URIStatus in the result of FileSystem.listStatus(alluxio.AlluxioURI). |
java.util.List<URIStatus> |
listStatus(AlluxioURI path,
ListStatusPOptions options)
If the path is a directory, returns the
URIStatus of all the direct entries in it. |
ListStatusPartialResult |
listStatusPartial(AlluxioURI path,
ListStatusPartialPOptions options)
Same as
FileSystem.listStatus(AlluxioURI, ListStatusPOptions) except may
only return a subset of the results as determined by the options parameter. |
void |
loadMetadata(AlluxioURI path,
ListStatusPOptions options)
Loads metadata about a path in the UFS to Alluxio.
|
void |
mount(AlluxioURI alluxioPath,
AlluxioURI ufsPath,
MountPOptions options)
Mounts a UFS subtree to the given Alluxio path.
|
void |
needsSync(AlluxioURI path)
Marks the path in Alluxio as needing sync with the UFS.
|
FileInStream |
openFile(AlluxioURI path,
OpenFilePOptions options)
Opens a file for reading.
|
FileInStream |
openFile(URIStatus status,
OpenFilePOptions options)
Opens a file for reading.
|
void |
persist(AlluxioURI path,
ScheduleAsyncPersistencePOptions options)
Schedules the given path to be asynchronously persisted to the under file system.
|
void |
rename(AlluxioURI src,
AlluxioURI dst,
RenamePOptions options)
Renames an existing Alluxio path to another Alluxio path in Alluxio.
|
AlluxioURI |
reverseResolve(AlluxioURI ufsUri)
Reverse resolve a ufs uri.
|
void |
setAcl(AlluxioURI path,
SetAclAction action,
java.util.List<AclEntry> entries,
SetAclPOptions options)
Sets the ACL for a path.
|
void |
setAttribute(AlluxioURI path,
SetAttributePOptions options)
Sets any number of a path's attributes, such as TTL and pin status.
|
void |
startSync(AlluxioURI path)
Starts the active syncing process on an Alluxio path.
|
void |
stopSync(AlluxioURI path)
Stops the active syncing process on an Alluxio path.
|
void |
unmount(AlluxioURI path,
UnmountPOptions options)
Unmounts a UFS subtree identified by the given Alluxio path.
|
void |
updateMount(AlluxioURI alluxioPath,
MountPOptions options)
Updates the options for an existing mount point.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDirectory, createFile, delete, exists, free, getMountTable, getStatus, iterateStatus, listStatus, loadMetadata, mount, openFile, persist, rename, setAcl, setAttribute, unmountprotected final FileSystem mDelegatedFileSystem
public DelegatingFileSystem(FileSystem fs)
fs - the underlying file systempublic boolean isClosed()
FileSystemisClosed in interface FileSystempublic void checkAccess(AlluxioURI path, CheckAccessPOptions options) throws InvalidPathException, java.io.IOException, AlluxioException
FileSystemcheckAccess in interface FileSystempath - the path of the directory to create in Alluxio spaceoptions - options to associate with this operationInvalidPathException - if the path is invalidAccessControlException - if the access is deniedjava.io.IOExceptionAlluxioExceptionpublic void createDirectory(AlluxioURI path, CreateDirectoryPOptions options) throws FileAlreadyExistsException, InvalidPathException, java.io.IOException, AlluxioException
FileSystemcreateDirectory in interface FileSystempath - the path of the directory to create in Alluxio spaceoptions - options to associate with this operationFileAlreadyExistsException - if there is already a file or directory at the given pathInvalidPathException - if the path is invalidjava.io.IOExceptionAlluxioExceptionpublic FileOutStream createFile(AlluxioURI path, CreateFilePOptions options) throws FileAlreadyExistsException, InvalidPathException, java.io.IOException, AlluxioException
FileSystemcreateFile in interface FileSystempath - the path of the file to create in Alluxio spaceoptions - options to associate with this operationFileOutStream which will write data to the newly created fileFileAlreadyExistsException - if there is already a file at the given pathInvalidPathException - if the path is invalidjava.io.IOExceptionAlluxioExceptionpublic void delete(AlluxioURI path, DeletePOptions options) throws DirectoryNotEmptyException, FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemdelete in interface FileSystempath - the path to delete in Alluxio spaceoptions - options to associate with this operationDirectoryNotEmptyException - if recursive is false and the path is a nonempty directoryFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic boolean exists(AlluxioURI path, ExistsPOptions options) throws InvalidPathException, java.io.IOException, AlluxioException
FileSystemexists in interface FileSystempath - the path in questionoptions - options to associate with this operationInvalidPathException - if the path is invalidjava.io.IOExceptionAlluxioExceptionpublic void free(AlluxioURI path, FreePOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemfree in interface FileSystempath - the path to free in Alluxio spaceoptions - options to associate with this operationFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic java.util.List<BlockLocationInfo> getBlockLocations(AlluxioURI path) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemBlockLocationInfo for the given file. Each list item contains a list
of WorkerNetAddress which allows a user to determine the physical location of a block
of the given file stored within Alluxio. In the case where data is stored in a UFS, but not in
Alluxio this function will only include a WorkerNetAddress if the block stored in the
UFS is co-located with an Alluxio worker.
However if there are no co-located Alluxio workers for the block, then the behavior is
controlled by the PropertyKey.USER_UFS_BLOCK_LOCATION_ALL_FALLBACK_ENABLED . If
this property is set to true then every Alluxio worker will be returned.
Blocks which are stored in the UFS and are *not* co-located with any Alluxio worker will return
an empty list. If the file block is within Alluxio *and* the UFS then this will only return
Alluxio workers which currently store the block.getBlockLocations in interface FileSystempath - the path to get block info forFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic java.util.List<BlockLocationInfo> getBlockLocations(URIStatus status) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemBlockLocationInfo for the given file.getBlockLocations in interface FileSystemstatus - the path statusFileDoesNotExistExceptionjava.io.IOExceptionAlluxioExceptionpublic AlluxioConfiguration getConf()
getConf in interface FileSystempublic URIStatus getStatus(AlluxioURI path, GetStatusPOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemURIStatus object that represents the metadata of an Alluxio path.getStatus in interface FileSystempath - the path to obtain information aboutoptions - options to associate with this operationURIStatus of the fileFileDoesNotExistException - if the path does not existjava.io.IOExceptionAlluxioExceptionpublic java.util.List<URIStatus> listStatus(AlluxioURI path, ListStatusPOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemURIStatus of all the direct entries in it.
Otherwise returns a list with a single URIStatus element for the file.listStatus in interface FileSystempath - the path to list information aboutoptions - options to associate with this operationURIStatuss containing information about the files and directories
which are children of the given pathFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic ListStatusPartialResult listStatusPartial(AlluxioURI path, ListStatusPartialPOptions options) throws AlluxioException, java.io.IOException
FileSystemFileSystem.listStatus(AlluxioURI, ListStatusPOptions) except may
only return a subset of the results as determined by the options parameter.listStatusPartial in interface FileSystempath - the path to list information aboutoptions - options to associate with this operationURIStatuss containing information about the files and directories
which are children of the given pathFileDoesNotExistException - if the given path does not existAlluxioExceptionjava.io.IOExceptionpublic void iterateStatus(AlluxioURI path, ListStatusPOptions options, java.util.function.Consumer<? super URIStatus> action) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemURIStatus in the result of FileSystem.listStatus(alluxio.AlluxioURI).
This method is preferred when iterating over directories with a large number of files or
sub-directories inside. The caller can proceed with partial result without waiting for all
result returned.iterateStatus in interface FileSystempath - the path to list information aboutoptions - options to associate with this operationaction - action to apply on each URIStatusFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic void loadMetadata(AlluxioURI path, ListStatusPOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemloadMetadata in interface FileSystempath - the path for which to load metadata from UFSoptions - options to associate with this operationFileDoesNotExistException - if the given path does not existjava.io.IOExceptionAlluxioExceptionpublic void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountPOptions options) throws java.io.IOException, AlluxioException
FileSystemAlluxioException will be thrown.
This method does not transfer any data or metadata from the UFS. It simply establishes the
connection between the given Alluxio path and UFS path.mount in interface FileSystemalluxioPath - an Alluxio path to mount the data toufsPath - a UFS path to mount the data fromoptions - options to associate with this operationjava.io.IOExceptionAlluxioExceptionpublic void updateMount(AlluxioURI alluxioPath, MountPOptions options) throws java.io.IOException, AlluxioException
FileSystemupdateMount in interface FileSystemalluxioPath - the Alluxio path of the mount pointoptions - options for this mount pointjava.io.IOExceptionAlluxioExceptionpublic java.util.Map<java.lang.String,MountPointInfo> getMountTable(boolean checkUfs) throws java.io.IOException, AlluxioException
FileSystemgetMountTable in interface FileSystemcheckUfs - whether to get UFS usage infoMountPointInfojava.io.IOExceptionAlluxioExceptionpublic java.util.List<SyncPointInfo> getSyncPathList() throws java.io.IOException, AlluxioException
FileSystemgetSyncPathList in interface FileSystemjava.io.IOExceptionAlluxioExceptionpublic FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, java.io.IOException, AlluxioException
FileSystemopenFile in interface FileSystempath - the file to read fromoptions - options to associate with this operationFileInStream for the given pathFileDoesNotExistException - when path does not existOpenDirectoryException - when path is a directoryFileIncompleteException - when path is a file and is not completed yetjava.io.IOExceptionAlluxioExceptionpublic FileInStream openFile(URIStatus status, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, java.io.IOException, AlluxioException
FileSystemopenFile in interface FileSystemstatus - status of the file to read fromoptions - options to associate with this operationFileInStream for the given pathFileDoesNotExistException - when path does not existOpenDirectoryException - when path is a directoryFileIncompleteException - when path is a file and is not completed yetjava.io.IOExceptionAlluxioExceptionpublic void persist(AlluxioURI path, ScheduleAsyncPersistencePOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemFileSystemUtils.persistAndWait(FileSystem, AlluxioURI, long).persist in interface FileSystempath - the uri of the file to persistoptions - the options to use when submitting persist the pathFileDoesNotExistExceptionjava.io.IOExceptionAlluxioExceptionpublic void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemrename in interface FileSystemsrc - the path of the source, this must already existdst - the path of the destination, this path should not existoptions - options to associate with this operationFileDoesNotExistException - if the given file does not existjava.io.IOExceptionAlluxioExceptionpublic AlluxioURI reverseResolve(AlluxioURI ufsUri) throws java.io.IOException, AlluxioException
FileSystemreverseResolve in interface FileSystemufsUri - the ufs uriAlluxioStatusExceptionjava.io.IOExceptionAlluxioExceptionpublic void setAcl(AlluxioURI path, SetAclAction action, java.util.List<AclEntry> entries, SetAclPOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemsetAcl in interface FileSystempath - the path to set the ACL foraction - the set action to performentries - the ACL entriesoptions - options to associate with this operationFileDoesNotExistException - if the given file does not existjava.io.IOExceptionAlluxioExceptionpublic void startSync(AlluxioURI path) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemstartSync in interface FileSystempath - the path to syncFileDoesNotExistExceptionjava.io.IOExceptionAlluxioExceptionpublic void stopSync(AlluxioURI path) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemstopSync in interface FileSystempath - the path to stop syncingFileDoesNotExistExceptionjava.io.IOExceptionAlluxioExceptionpublic void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, java.io.IOException, AlluxioException
FileSystemsetAttribute in interface FileSystempath - the path to set attributes foroptions - options to associate with this operationFileDoesNotExistException - if the given file does not existjava.io.IOExceptionAlluxioExceptionpublic void unmount(AlluxioURI path, UnmountPOptions options) throws java.io.IOException, AlluxioException
FileSystemunmount in interface FileSystempath - an Alluxio path, this must be a mount pointoptions - options to associate with this operationjava.io.IOExceptionAlluxioExceptionpublic void needsSync(AlluxioURI path) throws java.io.IOException, AlluxioException
FileSystemneedsSync in interface FileSystempath - the path needing synchronizationjava.io.IOExceptionAlluxioExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2022. All Rights Reserved.