@ThreadSafe public class MetadataCachingBaseFileSystem extends BaseFileSystem
FileSystem.Factory
mBlockStore, mClosed, mFsContext
Constructor and Description |
---|
MetadataCachingBaseFileSystem(FileSystemContext context) |
Modifier and Type | Method and Description |
---|---|
void |
asyncUpdateFileAccessTime(AlluxioURI path)
Asynchronously update file's last access time.
|
void |
close()
Shuts down the FileSystem.
|
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.
|
URIStatus |
getStatus(AlluxioURI path,
GetStatusPOptions options)
Gets the
URIStatus object that represents the metadata of an Alluxio path. |
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) . |
List<URIStatus> |
listStatus(AlluxioURI path,
ListStatusPOptions options)
If the path is a directory, returns the
URIStatus of all the direct entries in it. |
void |
rename(AlluxioURI src,
AlluxioURI dst,
RenamePOptions options)
Renames an existing Alluxio path to another Alluxio path in Alluxio.
|
checkAccess, checkUri, exists, free, getBlockLocations, getConf, getMountTable, getSyncPathList, isClosed, loadMetadata, mount, openFile, openFile, persist, reverseResolve, setAcl, setAttribute, startSync, stopSync, unmount, updateMount
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDirectory, createFile, delete, exists, free, getStatus, iterateStatus, listStatus, loadMetadata, mount, openFile, persist, rename, setAcl, setAttribute, unmount
public MetadataCachingBaseFileSystem(FileSystemContext context)
context
- the fs contextpublic void createDirectory(AlluxioURI path, CreateDirectoryPOptions options) throws FileAlreadyExistsException, InvalidPathException, IOException, AlluxioException
FileSystem
createDirectory
in interface FileSystem
createDirectory
in class BaseFileSystem
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
public FileOutStream createFile(AlluxioURI path, CreateFilePOptions options) throws IOException, AlluxioException
FileSystem
createFile
in interface FileSystem
createFile
in class BaseFileSystem
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
public void delete(AlluxioURI path, DeletePOptions options) throws IOException, AlluxioException
FileSystem
delete
in interface FileSystem
delete
in class BaseFileSystem
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
public void rename(AlluxioURI src, AlluxioURI dst, RenamePOptions options) throws IOException, AlluxioException
FileSystem
rename
in interface FileSystem
rename
in class BaseFileSystem
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
public URIStatus getStatus(AlluxioURI path, GetStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
FileSystem
URIStatus
object that represents the metadata of an Alluxio path.getStatus
in interface FileSystem
getStatus
in class BaseFileSystem
path
- the path to obtain information aboutoptions
- options to associate with this operationURIStatus
of the fileFileDoesNotExistException
- if the path does not existIOException
AlluxioException
public void iterateStatus(AlluxioURI path, ListStatusPOptions options, java.util.function.Consumer<? super URIStatus> action) throws FileDoesNotExistException, IOException, AlluxioException
FileSystem
URIStatus
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 FileSystem
iterateStatus
in class BaseFileSystem
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
public List<URIStatus> listStatus(AlluxioURI path, ListStatusPOptions options) throws FileDoesNotExistException, IOException, AlluxioException
FileSystem
URIStatus
of all the direct entries in it.
Otherwise returns a list with a single URIStatus
element for the file.listStatus
in interface FileSystem
listStatus
in class BaseFileSystem
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
public void asyncUpdateFileAccessTime(AlluxioURI path)
path
- the path to the filepublic void close() throws IOException
BaseFileSystem
close
in interface Closeable
close
in interface AutoCloseable
close
in class BaseFileSystem
IOException
Copyright © 2023. All Rights Reserved.