public final class FileSystemMasterClient extends MasterClientBase
mUseZookeeper
mAddress, mClosed, mConnected, mMode, mProtocol, mTachyonConf, RPC_MAX_NUM_RETRY
Constructor and Description |
---|
FileSystemMasterClient(InetSocketAddress masterAddress,
TachyonConf tachyonConf)
Creates a new file system master client.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterConnect() |
void |
completeFile(long fileId)
Marks a file as completed.
|
long |
create(String path,
CreateOptions options)
Creates a new file.
|
boolean |
deleteFile(long fileId,
boolean recursive)
Deletes a file.
|
boolean |
free(long fileId,
boolean recursive)
Frees a file.
|
FileBlockInfo |
getFileBlockInfo(long fileId,
int fileBlockIndex) |
List<FileBlockInfo> |
getFileBlockInfoList(long fileId) |
long |
getFileId(String path) |
FileInfo |
getFileInfo(long fileId) |
List<FileInfo> |
getFileInfoList(long fileId) |
long |
getNewBlockIdForFile(long fileId) |
protected String |
getServiceName() |
String |
getUfsAddress() |
long |
loadMetadata(String path,
boolean recursive)
Loads a file from the under file system.
|
boolean |
mkdir(String path,
MkdirOptions options)
Creates a new directory.
|
boolean |
mount(TachyonURI tachyonPath,
TachyonURI ufsPath)
Mounts the given UFS path under the given Tachyon path.
|
boolean |
renameFile(long fileId,
String dstPath)
Renames a file.
|
void |
reportLostFile(long fileId)
Reports a lost file.
|
void |
setPinned(long fileId,
boolean pinned)
Sets the "pinned" status for a file.
|
boolean |
unmount(TachyonURI tachyonPath)
Unmounts the given Tachyon path.
|
getAddress
afterDisconnect, close, connect, disconnect, isConnected, resetConnection
public FileSystemMasterClient(InetSocketAddress masterAddress, TachyonConf tachyonConf)
masterAddress
- the master addresstachyonConf
- the Tachyon configurationprotected String getServiceName()
getServiceName
in class ClientBase
protected void afterConnect()
afterConnect
in class ClientBase
public long getFileId(String path) throws IOException
path
- the pathIOException
- if an I/O error occurspublic FileInfo getFileInfo(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic List<FileInfo> getFileInfoList(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic FileBlockInfo getFileBlockInfo(long fileId, int fileBlockIndex) throws IOException, TachyonException
fileId
- the file idfileBlockIndex
- the file block indexIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic List<FileBlockInfo> getFileBlockInfoList(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic long getNewBlockIdForFile(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic String getUfsAddress() throws IOException
IOException
- if an I/O error occurspublic long create(String path, CreateOptions options) throws IOException, TachyonException
path
- the file pathoptions
- method optionsIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic void completeFile(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic boolean deleteFile(long fileId, boolean recursive) throws IOException, TachyonException
fileId
- the file idrecursive
- whether to delete the file recursively (when it is a directory)IOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic boolean renameFile(long fileId, String dstPath) throws IOException, TachyonException
fileId
- the file iddstPath
- new file pathIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic void setPinned(long fileId, boolean pinned) throws IOException, TachyonException
fileId
- the file idpinned
- the pinned status to useIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic boolean mkdir(String path, MkdirOptions options) throws IOException, TachyonException
path
- the directory pathoptions
- method optionsIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic boolean free(long fileId, boolean recursive) throws IOException, TachyonException
fileId
- the file idrecursive
- whether free the file recursively (when it is a directory)IOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic void reportLostFile(long fileId) throws IOException, TachyonException
fileId
- the file idIOException
- if an I/O error occursTachyonException
- if a Tachyon error occurspublic long loadMetadata(String path, boolean recursive) throws IOException, TachyonException
path
- the Tachyon path of the filerecursive
- whether parent directories should be loaded if not present yetTachyonException
- if a tachyon error occursIOException
- if an I/O error occurspublic boolean mount(TachyonURI tachyonPath, TachyonURI ufsPath) throws IOException
tachyonPath
- the Tachyon pathufsPath
- the UFS pathIOException
- an I/O error occurspublic boolean unmount(TachyonURI tachyonPath) throws IOException
tachyonPath
- the Tachyon pathIOException
- an I/O error occursCopyright © 2015. All Rights Reserved.