@PublicApi public abstract class AbstractTachyonFileSystem extends Object
TachyonFileSystemCore
interface.Modifier and Type | Field and Description |
---|---|
protected FileSystemContext |
mContext
The file system context which contains shared resources, such as the fs master client
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractTachyonFileSystem()
Constructor, currently TachyonFileSystem does not retain any state
|
Modifier and Type | Method and Description |
---|---|
TachyonFile |
create(TachyonURI path,
CreateOptions options)
Creates a file.
|
void |
delete(TachyonFile file,
DeleteOptions options)
Deletes a file or a directory.
|
void |
free(TachyonFile file,
FreeOptions options)
Removes the file from Tachyon, but not from UFS in case it exists there.
|
FileInfo |
getInfo(TachyonFile file,
GetInfoOptions options)
Gets the
FileInfo object that represents the metadata of a Tachyon file. |
List<FileInfo> |
listStatus(TachyonFile file,
ListStatusOptions options)
If the file is a directory, returns the
FileInfo of all the direct entries in it. |
TachyonFile |
loadMetadata(TachyonURI path,
LoadMetadataOptions options)
Loads metadata about a file in UFS to Tachyon.
|
boolean |
mkdir(TachyonURI path,
MkdirOptions options)
Creates a directory.
|
boolean |
mount(TachyonURI tachyonPath,
TachyonURI ufsPath,
MountOptions options)
Mounts a UFS subtree to the given Tachyon path.
|
TachyonFile |
open(TachyonURI path,
OpenOptions openOptions)
Resolves a
TachyonURI to a TachyonFile which is used as the file handler for
non-create operations. |
TachyonFile |
openIfExists(TachyonURI path,
OpenOptions openOptions)
Resolves a
TachyonURI to a TachyonFile which is used as the file handler for
non-create operations. |
boolean |
rename(TachyonFile src,
TachyonURI dst,
RenameOptions options)
Renames an existing Tachyon file to another Tachyon path in Tachyon.
|
void |
setState(TachyonFile file,
SetStateOptions options)
Sets the state of a file.
|
boolean |
unmount(TachyonURI tachyonPath,
UnmountOptions options)
Unmounts a UFS subtree identified by the given Tachyon path.
|
protected FileSystemContext mContext
protected AbstractTachyonFileSystem()
public TachyonFile create(TachyonURI path, CreateOptions options) throws FileAlreadyExistsException, IOException, InvalidPathException, TachyonException
path
- the path of the file to create in Tachyon spaceoptions
- method optionsTachyonFile
instance that identifies the newly created fileFileAlreadyExistsException
- if there is already a file at the given pathIOException
- if a non-Tachyon exception occursInvalidPathException
- if the path is invalidTachyonException
- if an unexpected tachyon exception is thrownpublic void delete(TachyonFile file, DeleteOptions options) throws IOException, FileDoesNotExistException, TachyonException
file
- the handler of the file to deleteoptions
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic void free(TachyonFile file, FreeOptions options) throws IOException, FileDoesNotExistException, TachyonException
file
- the handler for the fileoptions
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic FileInfo getInfo(TachyonFile file, GetInfoOptions options) throws IOException, FileDoesNotExistException, TachyonException
FileInfo
object that represents the metadata of a Tachyon file.
The file info is a snapshot of the file metadata, and the locations, last modified time, and
path are possibly inconsistent.file
- the handler for the file.options
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the file does not existTachyonException
public List<FileInfo> listStatus(TachyonFile file, ListStatusOptions options) throws IOException, FileDoesNotExistException, TachyonException
FileInfo
of all the direct entries in it.
Otherwise returns the FileInfo
for the file.
The file infos are snapshots of the file metadata, and the locations, last modified time, and
path are possibly inconsistent.file
- the handler for the fileoptions
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic TachyonFile loadMetadata(TachyonURI path, LoadMetadataOptions options) throws IOException, FileDoesNotExistException, TachyonException
path
- the path for which to load metadat from UFSoptions
- method optionsTachyonFile
instance identifying the resulting file in TachyonIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic boolean mkdir(TachyonURI path, MkdirOptions options) throws IOException, FileAlreadyExistsException, InvalidPathException, TachyonException
path
- the handler for the fileoptions
- method optionsIOException
- if a non-Tachyon exception occursFileAlreadyExistsException
- if there is already a file at the given pathInvalidPathException
- if the path is invalidTachyonException
- if an unexpected tachyon exception is thrownpublic boolean mount(TachyonURI tachyonPath, TachyonURI ufsPath, MountOptions options) throws IOException, TachyonException
tachyonPath
- a Tachyon pathufsPath
- a UFS pathoptions
- method optionsIOException
- if a non-Tachyon exception occursTachyonException
- if a Tachyon exception occurspublic TachyonFile open(TachyonURI path, OpenOptions openOptions) throws IOException, InvalidPathException, TachyonException
TachyonURI
to a TachyonFile
which is used as the file handler for
non-create operations.path
- the path of the file, this should be in Tachyon spaceopenOptions
- method optionsIOException
- if a non-Tachyon exception occursInvalidPathException
- if there is no file at the given pathTachyonException
- if an unexpected tachyon exception is thrownpublic TachyonFile openIfExists(TachyonURI path, OpenOptions openOptions) throws IOException, TachyonException
TachyonURI
to a TachyonFile
which is used as the file handler for
non-create operations.path
- the path of the file, this should be in Tachyon spaceopenOptions
- method optionsIOException
- if a non-Tachyon exception occursTachyonException
- if an unexpected tachyon exception is thrownpublic boolean rename(TachyonFile src, TachyonURI dst, RenameOptions options) throws IOException, FileDoesNotExistException, TachyonException
src
- the file handler for the source filedst
- the path of the destination file, this path should not existoptions
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic void setState(TachyonFile file, SetStateOptions options) throws IOException, FileDoesNotExistException, TachyonException
file
- the file handler for the file to pinoptions
- method optionsIOException
- if a non-Tachyon exception occursFileDoesNotExistException
- if the given file does not existTachyonException
- if an unexpected tachyon exception is thrownpublic boolean unmount(TachyonURI tachyonPath, UnmountOptions options) throws IOException, TachyonException
tachyonPath
- a Tachyon pathoptions
- method optionsIOException
- if a non-Tachyon exception occursTachyonException
- if a Tachyon exception occursCopyright © 2015. All Rights Reserved.