@PublicApi public interface FileSystem extends Closeable
BaseFileSystem
instead. This ensures any new methods added to the interface will be provided
by the default implementation.Modifier and Type | Interface and Description |
---|---|
static class |
FileSystem.Factory
Factory for
FileSystem . |
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(AlluxioURI path,
CheckAccessPOptions options)
Checks access to a path.
|
default void |
createDirectory(AlluxioURI path)
Convenience method for
createDirectory(AlluxioURI, CreateDirectoryPOptions) with
default options. |
void |
createDirectory(AlluxioURI path,
CreateDirectoryPOptions options)
Creates a directory.
|
default FileOutStream |
createFile(AlluxioURI path)
Convenience method for
createFile(AlluxioURI, CreateFilePOptions) with default
options. |
FileOutStream |
createFile(AlluxioURI path,
CreateFilePOptions options)
Creates a file.
|
default void |
delete(AlluxioURI path)
Convenience method for
delete(AlluxioURI, DeletePOptions) with default options. |
void |
delete(AlluxioURI path,
DeletePOptions options)
Deletes a file or a directory.
|
default boolean |
exists(AlluxioURI path)
Convenience method for
exists(AlluxioURI, ExistsPOptions) with default options. |
boolean |
exists(AlluxioURI path,
ExistsPOptions options)
Checks whether a path exists in Alluxio space.
|
default void |
free(AlluxioURI path)
Convenience method for
free(AlluxioURI, FreePOptions) with default options. |
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.
|
default List<BlockLocationInfo> |
getBlockLocations(AlluxioURI path)
Builds a list of
BlockLocationInfo for the given file. |
List<BlockLocationInfo> |
getBlockLocations(URIStatus status)
Builds a list of
BlockLocationInfo for the given file. |
AlluxioConfiguration |
getConf() |
String |
getLoadProgress(AlluxioURI path,
Optional<LoadProgressReportFormat> format,
boolean verbose)
Get progress of a load job.
|
default Map<String,MountPointInfo> |
getMountTable()
Lists all mount points and their corresponding under storage addresses.
|
Map<String,MountPointInfo> |
getMountTable(boolean checkUfs)
Lists all mount points and their corresponding under storage addresses.
|
default URIStatus |
getStatus(AlluxioURI path)
Convenience method for
getStatus(AlluxioURI, GetStatusPOptions) with default options. |
URIStatus |
getStatus(AlluxioURI path,
GetStatusPOptions options)
Gets the
URIStatus object that represents the metadata of an Alluxio path. |
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.
|
default void |
iterateStatus(AlluxioURI path,
java.util.function.Consumer<? super URIStatus> action)
Performs a specific action on each
URIStatus in the result of listStatus(alluxio.AlluxioURI) . |
void |
iterateStatus(AlluxioURI path,
ListStatusPOptions options,
java.util.function.Consumer<? super URIStatus> action)
Performs a specific action on each
URIStatus in the result of listStatus(alluxio.AlluxioURI) . |
default List<URIStatus> |
listStatus(AlluxioURI path)
Convenience method for
listStatus(AlluxioURI, ListStatusPOptions) with default
options. |
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
listStatus(AlluxioURI, ListStatusPOptions) except may
only return a subset of the results as determined by the options parameter. |
default void |
loadMetadata(AlluxioURI path)
Convenience method for
loadMetadata(AlluxioURI, ListStatusPOptions) with default
options. |
void |
loadMetadata(AlluxioURI path,
ListStatusPOptions options)
Loads metadata about a path in the UFS to Alluxio.
|
default void |
mount(AlluxioURI alluxioPath,
AlluxioURI ufsPath)
Convenience method for
mount(AlluxioURI, AlluxioURI, MountPOptions) with default
options. |
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.
|
default FileInStream |
openFile(AlluxioURI path)
Convenience method for
openFile(AlluxioURI, OpenFilePOptions) with default options. |
FileInStream |
openFile(AlluxioURI path,
OpenFilePOptions options)
Opens a file for reading.
|
FileInStream |
openFile(URIStatus status,
OpenFilePOptions options)
Opens a file for reading.
|
default void |
persist(AlluxioURI path)
Convenience method for
persist(AlluxioURI, ScheduleAsyncPersistencePOptions) which
uses the default ScheduleAsyncPersistencePOptions . |
void |
persist(AlluxioURI path,
ScheduleAsyncPersistencePOptions options)
Schedules the given path to be asynchronously persisted to the under file system.
|
default void |
rename(AlluxioURI src,
AlluxioURI dst)
Convenience method for
rename(AlluxioURI, AlluxioURI, RenamePOptions) with default
options. |
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.
|
default void |
setAcl(AlluxioURI path,
SetAclAction action,
List<AclEntry> entries)
Convenience method for
setAcl(AlluxioURI, SetAclAction, List, SetAclPOptions) with
default options. |
void |
setAcl(AlluxioURI path,
SetAclAction action,
List<AclEntry> entries,
SetAclPOptions options)
Sets the ACL for a path.
|
default void |
setAttribute(AlluxioURI path)
Convenience method for
setAttribute(AlluxioURI, SetAttributePOptions) with default
options. |
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.
|
boolean |
stopLoad(AlluxioURI path)
Stop a load job.
|
void |
stopSync(AlluxioURI path)
Stops the active syncing process on an Alluxio path.
|
boolean |
submitLoad(AlluxioURI path,
OptionalLong bandwidth,
boolean usePartialListing,
boolean verify)
Submit a load job.
|
default void |
unmount(AlluxioURI path)
Convenience method for
unmount(AlluxioURI, UnmountPOptions) with default options. |
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.
|
boolean isClosed()
void checkAccess(AlluxioURI path, CheckAccessPOptions options) throws InvalidPathException, IOException, AlluxioException
path
- 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 deniedIOException
AlluxioException
default void createDirectory(AlluxioURI path) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException
createDirectory(AlluxioURI, CreateDirectoryPOptions)
with
default options.path
- the path of the directory to create in Alluxio spaceFileAlreadyExistsException
- if there is already a file or directory at the given pathInvalidPathException
- if the path is invalidIOException
AlluxioException
void createDirectory(AlluxioURI path, CreateDirectoryPOptions options) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException
path
- 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 invalidIOException
AlluxioException
default FileOutStream createFile(AlluxioURI path) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException
createFile(AlluxioURI, CreateFilePOptions)
with default
options.path
- the path of the file to create in Alluxio spaceFileOutStream
which will write data to the newly created fileFileAlreadyExistsException
- if there is already a file at the given pathInvalidPathException
- if the path is invalidIOException
AlluxioException
FileOutStream createFile(AlluxioURI path, CreateFilePOptions options) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException
path
- 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 invalidIOException
AlluxioException
default void delete(AlluxioURI path) throws DirectoryNotEmptyException, FileDoesNotExistException, IOException, AlluxioException
delete(AlluxioURI, DeletePOptions)
with default options.path
- the path to delete in Alluxio spaceFileDoesNotExistException
- if the given path does not existDirectoryNotEmptyException
- if recursive is false and the path is a nonempty directoryIOException
AlluxioException
void delete(AlluxioURI path, DeletePOptions options) throws DirectoryNotEmptyException, FileDoesNotExistException, IOException, AlluxioException
path
- the path to delete in Alluxio spaceoptions
- options to associate with this operationFileDoesNotExistException
- if the given path does not existDirectoryNotEmptyException
- if recursive is false and the path is a nonempty directoryIOException
AlluxioException
default boolean exists(AlluxioURI path) throws InvalidPathException, IOException, AlluxioException
exists(AlluxioURI, ExistsPOptions)
with default options.path
- the path in questionInvalidPathException
- if the path is invalidIOException
AlluxioException
boolean exists(AlluxioURI path, ExistsPOptions options) throws InvalidPathException, IOException, AlluxioException
path
- the path in questionoptions
- options to associate with this operationInvalidPathException
- if the path is invalidIOException
AlluxioException
default void free(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
free(AlluxioURI, FreePOptions)
with default options.path
- the path to free in Alluxio spaceFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
void free(AlluxioURI path, FreePOptions options) throws FileDoesNotExistException, IOException, AlluxioException
path
- the path to free in Alluxio spaceoptions
- options to associate with this operationFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
default List<BlockLocationInfo> getBlockLocations(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
BlockLocationInfo
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.path
- the path to get block info forFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
List<BlockLocationInfo> getBlockLocations(URIStatus status) throws FileDoesNotExistException, IOException, AlluxioException
BlockLocationInfo
for the given file.status
- the path statusFileDoesNotExistException
IOException
AlluxioException
AlluxioConfiguration getConf()
default URIStatus getStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
getStatus(AlluxioURI, GetStatusPOptions)
with default options.path
- the path to obtain information aboutURIStatus
of the fileFileDoesNotExistException
- if the path does not existIOException
AlluxioException
URIStatus getStatus(AlluxioURI path, GetStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
URIStatus
object that represents the metadata of an Alluxio path.path
- the path to obtain information aboutoptions
- options to associate with this operationURIStatus
of the fileFileDoesNotExistException
- if the path does not existIOException
AlluxioException
default void iterateStatus(AlluxioURI path, java.util.function.Consumer<? super URIStatus> action) throws FileDoesNotExistException, IOException, AlluxioException
URIStatus
in the result of 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.path
- the path to list information aboutaction
- action to apply on each URIStatus
FileDoesNotExistException
- if the given path does not existIOException
AlluxioException
void iterateStatus(AlluxioURI path, ListStatusPOptions options, java.util.function.Consumer<? super URIStatus> action) throws FileDoesNotExistException, IOException, AlluxioException
URIStatus
in the result of 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.path
- the path to list information aboutoptions
- options to associate with this operationaction
- action to apply on each URIStatus
FileDoesNotExistException
- if the given path does not existIOException
AlluxioException
default List<URIStatus> listStatus(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
listStatus(AlluxioURI, ListStatusPOptions)
with default
options.path
- the path to list information aboutURIStatus
s containing information about the files and directories
which are children of the given pathFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
List<URIStatus> listStatus(AlluxioURI path, ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
URIStatus
of all the direct entries in it.
Otherwise returns a list with a single URIStatus
element for the file.path
- the path to list information aboutoptions
- options to associate with this operationURIStatus
s containing information about the files and directories
which are children of the given pathFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
ListStatusPartialResult listStatusPartial(AlluxioURI path, ListStatusPartialPOptions options) throws AlluxioException, IOException
listStatus(AlluxioURI, ListStatusPOptions)
except may
only return a subset of the results as determined by the options parameter.path
- the path to list information aboutoptions
- options to associate with this operationURIStatus
s containing information about the files and directories
which are children of the given pathFileDoesNotExistException
- if the given path does not existAlluxioException
IOException
default void loadMetadata(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
loadMetadata(AlluxioURI, ListStatusPOptions)
with default
options.path
- the path for which to load metadata from UFSFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
void loadMetadata(AlluxioURI path, ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
path
- the path for which to load metadata from UFSoptions
- options to associate with this operationFileDoesNotExistException
- if the given path does not existIOException
AlluxioException
default void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath) throws IOException, AlluxioException
mount(AlluxioURI, AlluxioURI, MountPOptions)
with default
options.alluxioPath
- an Alluxio path to mount the data toufsPath
- a UFS path to mount the data fromIOException
AlluxioException
void mount(AlluxioURI alluxioPath, AlluxioURI ufsPath, MountPOptions options) throws IOException, AlluxioException
AlluxioException
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.alluxioPath
- an Alluxio path to mount the data toufsPath
- a UFS path to mount the data fromoptions
- options to associate with this operationIOException
AlluxioException
void updateMount(AlluxioURI alluxioPath, MountPOptions options) throws IOException, AlluxioException
alluxioPath
- the Alluxio path of the mount pointoptions
- options for this mount pointIOException
AlluxioException
default Map<String,MountPointInfo> getMountTable() throws IOException, AlluxioException
getMountTable(boolean)
with true argument.MountPointInfo
IOException
AlluxioException
Map<String,MountPointInfo> getMountTable(boolean checkUfs) throws IOException, AlluxioException
checkUfs
- whether to get UFS usage infoMountPointInfo
IOException
AlluxioException
List<SyncPointInfo> getSyncPathList() throws IOException, AlluxioException
IOException
AlluxioException
default FileInStream openFile(AlluxioURI path) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException
openFile(AlluxioURI, OpenFilePOptions)
with default options.path
- the file to read fromFileInStream
for the given pathFileDoesNotExistException
- when path does not existOpenDirectoryException
- when path is a directoryFileIncompleteException
- when path is a file and is not completed yetIOException
AlluxioException
FileInStream openFile(AlluxioURI path, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException
path
- 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 yetIOException
AlluxioException
FileInStream openFile(URIStatus status, OpenFilePOptions options) throws FileDoesNotExistException, OpenDirectoryException, FileIncompleteException, IOException, AlluxioException
status
- 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 yetIOException
AlluxioException
default void persist(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
persist(AlluxioURI, ScheduleAsyncPersistencePOptions)
which
uses the default ScheduleAsyncPersistencePOptions
.path
- the uri of the file to persistFileDoesNotExistException
IOException
AlluxioException
void persist(AlluxioURI path, ScheduleAsyncPersistencePOptions options) throws FileDoesNotExistException, IOException, AlluxioException
FileSystemUtils.persistAndWait(FileSystem, AlluxioURI, long)
.path
- the uri of the file to persistoptions
- the options to use when submitting persist the pathFileDoesNotExistException
IOException
AlluxioException
default void rename(AlluxioURI src, AlluxioURI dst) throws FileDoesNotExistException, IOException, AlluxioException
rename(AlluxioURI, AlluxioURI, RenamePOptions)
with default
options.src
- the path of the source, this must already existdst
- the path of the destination, this path should not existFileDoesNotExistException
- if the given file does not existIOException
AlluxioException
void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options) throws FileDoesNotExistException, IOException, AlluxioException
src
- 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 existIOException
AlluxioException
AlluxioURI reverseResolve(AlluxioURI ufsUri) throws IOException, AlluxioException
ufsUri
- the ufs uriAlluxioStatusException
IOException
AlluxioException
default void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries) throws FileDoesNotExistException, IOException, AlluxioException
setAcl(AlluxioURI, SetAclAction, List, SetAclPOptions)
with
default options.path
- the path to set the ACL foraction
- the set action to performentries
- the ACL entriesFileDoesNotExistException
- if the given file does not existIOException
AlluxioException
void setAcl(AlluxioURI path, SetAclAction action, List<AclEntry> entries, SetAclPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
path
- 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 existIOException
AlluxioException
void startSync(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
path
- the path to syncFileDoesNotExistException
IOException
AlluxioException
void stopSync(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
path
- the path to stop syncingFileDoesNotExistException
IOException
AlluxioException
default void setAttribute(AlluxioURI path) throws FileDoesNotExistException, IOException, AlluxioException
setAttribute(AlluxioURI, SetAttributePOptions)
with default
options.path
- the path to set attributes forFileDoesNotExistException
- if the given file does not existIOException
AlluxioException
void setAttribute(AlluxioURI path, SetAttributePOptions options) throws FileDoesNotExistException, IOException, AlluxioException
path
- the path to set attributes foroptions
- options to associate with this operationFileDoesNotExistException
- if the given file does not existIOException
AlluxioException
default void unmount(AlluxioURI path) throws IOException, AlluxioException
unmount(AlluxioURI, UnmountPOptions)
with default options.path
- an Alluxio path, this must be a mount pointIOException
AlluxioException
void unmount(AlluxioURI path, UnmountPOptions options) throws IOException, AlluxioException
path
- an Alluxio path, this must be a mount pointoptions
- options to associate with this operationIOException
AlluxioException
void needsSync(AlluxioURI path) throws IOException, AlluxioException
path
- the path needing synchronizationIOException
AlluxioException
boolean submitLoad(AlluxioURI path, OptionalLong bandwidth, boolean usePartialListing, boolean verify)
path
- alluxio path to be loadedbandwidth
- bandwidth allocated to this load, unlimited if emptyusePartialListing
- whether to use partial listingverify
- whether to verify after load finishesboolean stopLoad(AlluxioURI path)
path
- alluxio path to be stoppedString getLoadProgress(AlluxioURI path, Optional<LoadProgressReportFormat> format, boolean verbose)
path
- alluxio path to get progressformat
- progress report formatverbose
- whether to return verbose reportCopyright © 2023. All Rights Reserved.