@PublicApi @Deprecated public class TachyonFS extends Object
TachyonFileSystem
Modifier and Type | Field and Description |
---|---|
protected TachyonConf |
mTachyonConf
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheBlock(long blockId)
Deprecated.
Notifies the worker that the block is cached.
|
void |
cancelBlock(long blockId)
Deprecated.
Notifies the worker the block is canceled.
|
void |
close()
Deprecated.
Closes the client connections to both the master and worker.
|
int |
createDependency(List<String> parents,
List<String> children,
String commandPrefix,
List<ByteBuffer> data,
String comment,
String framework,
String frameworkVersion,
int dependencyType,
long childrenBlockSizeByte)
Deprecated.
|
long |
createFile(TachyonURI path)
Deprecated.
Creates a file with the default block size (1GB) in the system.
|
long |
createFile(TachyonURI path,
long blockSizeByte)
Deprecated.
Creates a file in the system.
|
long |
createFile(TachyonURI path,
TachyonURI ufsPath)
Deprecated.
Creates a file in the system with a pre-defined underfsPath.
|
long |
createFile(TachyonURI path,
TachyonURI ufsPath,
long blockSizeBytes,
boolean recursive)
Deprecated.
Creates a new file in the file system.
|
long |
createRawTable(TachyonURI path,
int columns)
Deprecated.
Creates a
RawTable and returns its id. |
long |
createRawTable(TachyonURI path,
int columns,
ByteBuffer metadata)
Deprecated.
Creates a
RawTable and returns its id. |
boolean |
delete(long fid,
boolean recursive)
Deprecated.
Deletes the file denoted by the file id.
|
boolean |
delete(long fileId,
TachyonURI path,
boolean recursive)
Deprecated.
Deletes a file or folder.
|
boolean |
delete(TachyonURI path,
boolean recursive)
Deprecated.
Deletes the file denoted by the path.
|
boolean |
exist(TachyonURI path)
Deprecated.
Returns whether the file exists or not.
|
boolean |
freepath(long fileId,
TachyonURI path,
boolean recursive)
Deprecated.
Frees an in-memory file or folder.
|
boolean |
freepath(TachyonURI path,
boolean recursive)
Deprecated.
Frees the in-memory blocks of file/folder denoted by the path.
|
static TachyonFS |
get(String tachyonPath)
Deprecated.
|
static TachyonFS |
get(String masterHost,
int masterPort,
boolean zkMode)
Deprecated.
Creates a
TachyonFS handler for the given hostname, port, and Zookeeper mode. |
static TachyonFS |
get(TachyonConf tachyonConf)
Deprecated.
Creates a
TachyonFS handler for the given Tachyon configuration. |
static TachyonFS |
get(TachyonURI tachyonURI)
Deprecated.
|
static TachyonFS |
get(TachyonURI tachyonURI,
TachyonConf tachyonConf)
Deprecated.
Creates a
TachyonFS handler for the given Tachyon URI and configuration. |
long |
getBlockId(long fileId,
int blockIndex)
Deprecated.
Get the block id by the file id and block index.
|
long |
getCapacityBytes()
Deprecated.
Currently unsupported.
|
DependencyInfo |
getClientDependencyInfo(int depId)
Deprecated.
|
TachyonFile |
getFile(long fid)
Deprecated.
Gets
TachyonFile based on the file id. |
TachyonFile |
getFile(long fid,
boolean useCachedMetadata)
Deprecated.
Gets
TachyonFile based on the file id. |
TachyonFile |
getFile(TachyonURI path)
Deprecated.
Gets
TachyonFile based on the path. |
TachyonFile |
getFile(TachyonURI path,
boolean useCachedMetadata)
Deprecated.
Gets
TachyonFile based on the path. |
List<FileBlockInfo> |
getFileBlocks(long fid)
Deprecated.
Gets all the blocks' info of the file.
|
long |
getFileId(TachyonURI path)
Deprecated.
Get file id by the path.
|
FileInfo |
getFileStatus(long fileId,
boolean useCachedMetadata)
Deprecated.
Gets
ClientFileInfo object based on fileId. |
FileInfo |
getFileStatus(long fileId,
TachyonURI path)
Deprecated.
|
FileInfo |
getFileStatus(long fileId,
TachyonURI path,
boolean useCachedMetadata)
Deprecated.
Advanced API.
|
String |
getLocalBlockTemporaryPath(long blockId,
long initialBytes)
Deprecated.
Gets block's temporary path from worker with initial space allocated.
|
RawTable |
getRawTable(long id)
Deprecated.
Gets
RawTable by id. |
RawTable |
getRawTable(TachyonURI path)
Deprecated.
Get the
RawTable by path. |
String |
getUfsAddress()
Deprecated.
|
TachyonURI |
getUri()
Deprecated.
|
long |
getUsedBytes()
Deprecated.
Currently unsupported.
|
InetSocketAddress |
getWorkerDataServerAddress()
Deprecated.
|
List<WorkerInfo> |
getWorkersInfo()
Deprecated.
|
boolean |
hasLocalWorker()
Deprecated.
|
boolean |
isConnected()
Deprecated.
Checks if this client is connected to master.
|
List<FileInfo> |
listStatus(TachyonURI path)
Deprecated.
If the
path is a directory, returns all the direct entries in it. |
boolean |
mkdir(TachyonURI path)
Deprecated.
Create a directory if it does not exist.
|
boolean |
mkdirs(TachyonURI path,
boolean recursive)
Deprecated.
Creates a folder.
|
void |
pinFile(long fid)
Deprecated.
An alias for setPinned(fid, true).
|
boolean |
promoteBlock(long blockId)
Deprecated.
Promotes a block to the top StorageTier, after the block file is accessed.
|
boolean |
rename(long fileId,
TachyonURI dstPath)
Deprecated.
Renames the file.
|
boolean |
rename(long fileId,
TachyonURI srcPath,
TachyonURI dstPath)
Deprecated.
Renames a file or folder to the indicated new path.
|
boolean |
rename(TachyonURI srcPath,
TachyonURI dstPath)
Deprecated.
Renames the srcPath to the dstPath.
|
void |
reportLostFile(long fileId)
Deprecated.
Reports the lost file to master.
|
void |
requestFilesInDependency(int depId)
Deprecated.
|
long |
requestSpace(long blockId,
long requestSpaceBytes)
Deprecated.
Tries to request space for certain block.
|
void |
setPinned(long fid,
boolean pinned)
Deprecated.
Sets the "pinned" flag for the given file.
|
String |
toString()
Deprecated.
Prints out the string representation of this Tachyon server address.
|
void |
unpinFile(long fid)
Deprecated.
An alias for setPinned(fid, false).
|
void |
updateRawTableMetadata(long id,
ByteBuffer metadata)
Deprecated.
Updates the RawTable's meta data.
|
protected final TachyonConf mTachyonConf
@Deprecated public static TachyonFS get(String tachyonPath)
TachyonFS
handler for the given path.tachyonPath
- a Tachyon path contains master address. e.g., tachyon://localhost:19998,
tachyon://localhost:19998/ab/c.txtget(tachyon.TachyonURI, tachyon.conf.TachyonConf)
@Deprecated public static TachyonFS get(TachyonURI tachyonURI)
TachyonFS
handler for the given Tachyon URI.tachyonURI
- a Tachyon URI to indicate master address. e.g., tachyon://localhost:19998,
tachyon://localhost:19998/ab/c.txtget(tachyon.TachyonURI, tachyon.conf.TachyonConf)
public static TachyonFS get(TachyonURI tachyonURI, TachyonConf tachyonConf)
TachyonFS
handler for the given Tachyon URI and configuration.tachyonURI
- a Tachyon URI to indicate master address. e.g., tachyon://localhost:19998,
tachyon://localhost:19998/ab/c.txttachyonConf
- The TachyonConf instance.public static TachyonFS get(String masterHost, int masterPort, boolean zkMode)
TachyonFS
handler for the given hostname, port, and Zookeeper mode.masterHost
- master host detailsmasterPort
- port master listens onzkMode
- use zookeeperpublic static TachyonFS get(TachyonConf tachyonConf)
TachyonFS
handler for the given Tachyon configuration.tachyonConf
- The TachyonConf instance.public void cacheBlock(long blockId) throws IOException
blockId
- the block idIOException
- if the underlying worker RPC failspublic void cancelBlock(long blockId) throws IOException
blockId
- the block idIOException
- if the underlying worker RPC failspublic void close() throws IOException
IOException
- if the connections could not be closed@Deprecated public int createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws IOException
parents
- the dependency's input fileschildren
- the dependency's output filescommandPrefix
- identifies a command prefixdata
- stores dependency datacomment
- records a dependency commentframework
- identifies the frameworkframeworkVersion
- identifies the framework versiondependencyType
- the dependency's type, Wide or NarrowchildrenBlockSizeByte
- the block size of the dependency's output filesIOException
- if the underlying master RPC failspublic long createFile(TachyonURI path, TachyonURI ufsPath, long blockSizeBytes, boolean recursive) throws IOException
path
- The path of the fileufsPath
- The path of the file in the under file system. If this is empty, the file does
not exist in the under file system yet.blockSizeBytes
- The size of the block in bytes. It is -1 iff ufsPath is non-empty.recursive
- Creates necessary parent folders if true, not otherwise.IOException
- if the underlying master RPC failspublic long createRawTable(TachyonURI path, int columns) throws IOException
RawTable
and returns its id.path
- the RawTable's pathcolumns
- number of columns it hasIOException
- if the number of columns is invalid or the underlying master RPC failspublic long createRawTable(TachyonURI path, int columns, ByteBuffer metadata) throws IOException
RawTable
and returns its id.
Currently unsupported.path
- the RawTable's pathcolumns
- number of columns it hasmetadata
- the meta data of the RawTableIdUtils.INVALID_FILE_ID
otherwiseIOException
- if the number of columns is invalid or the underlying master RPC failspublic boolean delete(long fileId, TachyonURI path, boolean recursive) throws IOException
fileId
- The id of the file / folder. If it is not INVALID_FILE_ID, path parameter is
ignored. Otherwise, the method uses the path parameter.path
- The path of the file / folder. It could be empty iff id is not INVALID_FILE_ID.recursive
- If fileId or path represents a non-empty folder, delete the folder recursively
or not.IOException
- if the underlying master RPC failspublic boolean exist(TachyonURI path) throws IOException
path
- the file's path in Tachyon file systemIOException
- if the underlying master RPC failspublic long getBlockId(long fileId, int blockIndex) throws IOException
fileId
- the file idblockIndex
- The index of the block in the file.IOException
- if the file does not exist, or connection issue was encountered@Deprecated public DependencyInfo getClientDependencyInfo(int depId) throws IOException
depId
- the dependency idIOException
- if the underlying master RPC failspublic TachyonFile getFile(long fid) throws IOException
TachyonFile
based on the file id.
NOTE: This *will* use cached file metadata, and so will not see changes to dynamic properties,
such as the pinned flag. This is also different from the behavior of getFile(path), which by
default will not use cached metadata.fid
- file id.TachyonFile
of the file id, or null if the file does not existIOException
- if the underlying master RPC failspublic TachyonFile getFile(long fid, boolean useCachedMetadata) throws IOException
TachyonFile
based on the file id. If useCachedMetadata, this will not see
changes to the file's pin setting, or other dynamic properties.fid
- the file iduseCachedMetadata
- whether to use cached metadataIOException
- if the underlying master RPC failspublic TachyonFile getFile(TachyonURI path) throws IOException
TachyonFile
based on the path. Does not utilize the file metadata cache.path
- file path.IOException
- if the underlying master RPC failspublic TachyonFile getFile(TachyonURI path, boolean useCachedMetadata) throws IOException
TachyonFile
based on the path. If useCachedMetadata is true, this will not
see changes to the file's pin setting, or other dynamic properties.path
- file path.useCachedMetadata
- whether to use the file metadata cacheIOException
- if the underlying master RPC failspublic List<FileBlockInfo> getFileBlocks(long fid) throws IOException
fid
- the file idIOException
- if the underlying master RPC failspublic long getFileId(TachyonURI path)
path
- the path in Tachyon file systempublic FileInfo getFileStatus(long fileId, TachyonURI path, boolean useCachedMetadata) throws IOException
fileId
- the file id of the file or folder.path
- the path of the file or folder. valid iff fileId is INVALID_FILE_ID.useCachedMetadata
- if true use the local cached meta dataIOException
- if the underlying master RPC failspublic FileInfo getFileStatus(long fileId, TachyonURI path) throws IOException
IOException
public FileInfo getFileStatus(long fileId, boolean useCachedMetadata) throws IOException
ClientFileInfo
object based on fileId.fileId
- the file id of the file or folder.useCachedMetadata
- if true use the local cached meta dataIOException
- if the underlying master RPC failspublic String getLocalBlockTemporaryPath(long blockId, long initialBytes) throws IOException
blockId
- the id of the blockinitialBytes
- the initial bytes allocated for the block fileIOException
- if the underlying worker RPC failspublic RawTable getRawTable(long id) throws IOException
RawTable
by id.
Currently unsupported.id
- the id of the raw tableIOException
- if the underlying master RPC failspublic RawTable getRawTable(TachyonURI path) throws IOException
RawTable
by path.
Currently unsupported.path
- the path of the raw tableIOException
- if the underlying master RPC failspublic String getUfsAddress() throws IOException
IOException
- if the underlying master RPC failspublic TachyonURI getUri()
public long getUsedBytes() throws IOException
IOException
- if the underlying master RPC failspublic long getCapacityBytes() throws IOException
IOException
- if the underlying master RPC failspublic InetSocketAddress getWorkerDataServerAddress()
public List<WorkerInfo> getWorkersInfo() throws IOException
IOException
- if the underlying master RPC failspublic boolean hasLocalWorker()
public boolean isConnected()
public List<FileInfo> listStatus(TachyonURI path) throws IOException
path
is a directory, returns all the direct entries in it. If the
path
is a file, returns its ClientFileInfo.path
- the target directory/file pathIOException
- when the underlying master RPC failspublic boolean mkdirs(TachyonURI path, boolean recursive) throws IOException
path
- the path of the folder to be createdrecursive
- Creates necessary parent folders if true, not otherwise.IOException
- if the underlying master RPC failspublic void pinFile(long fid) throws IOException
IOException
- when the underlying worker RPC failssetPinned(long, boolean)
public boolean freepath(long fileId, TachyonURI path, boolean recursive) throws IOException
fileId
- The id of the file / folder. If it is not INVALID_FILE_ID, path parameter is
ignored. Otherwise, the method uses the path parameter.path
- The path of the file / folder. It could be empty iff id is not INVALID_FILE_ID.recursive
- If fileId or path represents a non-empty folder, free the folder recursively
or notIOException
- if the underlying master RPC failspublic boolean promoteBlock(long blockId) throws IOException
blockId
- the id of the blockIOException
- if the underlying worker RPC failspublic boolean rename(long fileId, TachyonURI srcPath, TachyonURI dstPath) throws IOException
fileId
- The id of the source file / folder. If it is not INVALID_FILE_ID, path parameter
is ignored. Otherwise, the method uses the srcPath parameter.srcPath
- The path of the source file / folder. It could be empty iff id is not
INVALID_FILE_ID.dstPath
- The path of the destination file / folder. It could be empty iff id is not
INVALID_FILE_ID.IOException
- if the underlying master RPC failspublic void reportLostFile(long fileId) throws IOException
fileId
- the lost file idIOException
- if the underlying master RPC fails@Deprecated public void requestFilesInDependency(int depId) throws IOException
depId
- the dependency idIOException
- if the underlying master RPC failspublic long requestSpace(long blockId, long requestSpaceBytes) throws IOException
blockId
- the id of the block that space will be allocated forrequestSpaceBytes
- size to request in bytesIOException
- if the underlying file does not existpublic void setPinned(long fid, boolean pinned) throws IOException
fid
- the file idpinned
- the target "pinned" flag valueIOException
- if the underlying master RPC failspublic String toString()
public void unpinFile(long fid) throws IOException
IOException
- when the underlying worker RPC failssetPinned(long, boolean)
public void updateRawTableMetadata(long id, ByteBuffer metadata) throws IOException
id
- the raw table's idmetadata
- the new meta dataIOException
- if the underlying master RPC failspublic long createFile(TachyonURI path) throws IOException
path
- the path of the fileIOException
- if the operation failspublic long createFile(TachyonURI path, long blockSizeByte) throws IOException
path
- the path of the fileblockSizeByte
- the block size of the fileIOException
- if the operation failspublic long createFile(TachyonURI path, TachyonURI ufsPath) throws IOException
path
- the path of the file in TachyonufsPath
- the path of the file in the underfsIOException
- if the operation failspublic boolean delete(long fid, boolean recursive) throws IOException
fid
- file idrecursive
- if delete the path recursively.IOException
- if the operation failspublic boolean delete(TachyonURI path, boolean recursive) throws IOException
path
- the file pathrecursive
- if delete the path recursively.IOException
- if the operation failspublic boolean mkdir(TachyonURI path) throws IOException
path
- Directory path.IOException
- if the operation failspublic boolean rename(long fileId, TachyonURI dstPath) throws IOException
fileId
- the file iddstPath
- the new path of the file in the file system.IOException
- if the operation failspublic boolean rename(TachyonURI srcPath, TachyonURI dstPath) throws IOException
srcPath
- The path of the source file / folder.dstPath
- The path of the destination file / folder.IOException
- if the operation failspublic boolean freepath(TachyonURI path, boolean recursive) throws IOException
path
- the file/folder pathrecursive
- if free the path recursivelyIOException
- if the operation failsCopyright © 2015. All Rights Reserved.