tachyon.client
Class TachyonClient
java.lang.Object
tachyon.client.TachyonClient
public class TachyonClient
- extends Object
Tachyon's user client API. It contains a MasterClient and several WorkerClients
depending on how many workers the client program is interacting with.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getClient
public static TachyonClient getClient(InetSocketAddress tachyonAddress)
getClient
public static TachyonClient getClient(String tachyonAddress)
accessLocalFile
public void accessLocalFile(int fileId)
addCheckpoint
public void addCheckpoint(int fileId)
throws IOException
- Throws:
IOException
addCheckpointPath
public boolean addCheckpointPath(int id,
String path)
throws FileDoesNotExistException,
SuspectedFileSizeException,
org.apache.thrift.TException,
IOException
- This API is not recommended to use.
- Parameters:
id
- file idpath
- existing checkpoint path
- Returns:
- true if the checkpoint path is added successfully, false otherwise.
- Throws:
org.apache.thrift.TException
SuspectedFileSizeException
FileDoesNotExistException
IOException
cacheFile
public void cacheFile(int fileId)
throws IOException
- Throws:
IOException
connect
public void connect()
close
public void close()
throws org.apache.thrift.TException
- Throws:
org.apache.thrift.TException
createAndGetUserTempFolder
public File createAndGetUserTempFolder()
createAndGetUserUnderfsTempFolder
public String createAndGetUserUnderfsTempFolder()
throws IOException
- Throws:
IOException
createRawTable
public int createRawTable(String path,
int columns)
throws InvalidPathException,
FileAlreadyExistException,
TableColumnException
- Throws:
InvalidPathException
FileAlreadyExistException
TableColumnException
createRawTable
public int createRawTable(String path,
int columns,
ByteBuffer metadata)
throws InvalidPathException,
FileAlreadyExistException,
TableColumnException
- Throws:
InvalidPathException
FileAlreadyExistException
TableColumnException
createFile
public int createFile(String path)
throws InvalidPathException,
FileAlreadyExistException
- Throws:
InvalidPathException
FileAlreadyExistException
delete
public boolean delete(int fileId)
delete
public boolean delete(String path)
throws InvalidPathException
- Throws:
InvalidPathException
exist
public boolean exist(String path)
throws InvalidPathException
- Throws:
InvalidPathException
rename
public boolean rename(String srcPath,
String dstPath)
throws InvalidPathException
- Throws:
InvalidPathException
getFileNetAddresses
public List<NetAddress> getFileNetAddresses(int fileId)
throws IOException
- Throws:
IOException
getFilesNetAddresses
public List<List<NetAddress>> getFilesNetAddresses(List<Integer> fileIds)
throws IOException
- Throws:
IOException
getFileHosts
public List<String> getFileHosts(int fileId)
throws IOException
- Throws:
IOException
getFilesHosts
public List<List<String>> getFilesHosts(List<Integer> fileIds)
throws IOException
- Throws:
IOException
getFile
public TachyonFile getFile(String path)
throws InvalidPathException
- Throws:
InvalidPathException
getFile
public TachyonFile getFile(String path,
boolean useCachedMetadata)
throws InvalidPathException
- Throws:
InvalidPathException
getFile
public TachyonFile getFile(int fileId)
getFileId
public int getFileId(String path)
throws InvalidPathException
- Throws:
InvalidPathException
getNumberOfFiles
public int getNumberOfFiles(String folderPath)
throws FileDoesNotExistException,
InvalidPathException,
org.apache.thrift.TException
- Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException
getRawTable
public RawTable getRawTable(String path)
throws TableDoesNotExistException,
InvalidPathException,
org.apache.thrift.TException
- Throws:
TableDoesNotExistException
InvalidPathException
org.apache.thrift.TException
getRawTable
public RawTable getRawTable(int id)
throws TableDoesNotExistException,
org.apache.thrift.TException
- Throws:
TableDoesNotExistException
org.apache.thrift.TException
getRootFolder
public String getRootFolder()
hasLocalWorker
public boolean hasLocalWorker()
isConnected
public boolean isConnected()
listFiles
public List<Integer> listFiles(String path,
boolean recursive)
throws IOException
- Throws:
IOException
listStatus
public List<ClientFileInfo> listStatus(String path)
throws FileDoesNotExistException,
InvalidPathException,
org.apache.thrift.TException
- Throws:
FileDoesNotExistException
InvalidPathException
org.apache.thrift.TException
ls
public List<String> ls(String path,
boolean recursive)
throws IOException
- Throws:
IOException
lockFile
public boolean lockFile(int fileId)
mkdir
public int mkdir(String path)
throws InvalidPathException,
FileAlreadyExistException
- Create a directory if it does not exist.
- Parameters:
path
- Directory path.
- Returns:
- The inode ID of the directory if it is successfully created. -1 if not.
- Throws:
InvalidPathException
FileAlreadyExistException
outOfMemoryForPinFile
public void outOfMemoryForPinFile(int fileId)
releaseSpace
public void releaseSpace(long releaseSpaceBytes)
requestSpace
public boolean requestSpace(long requestSpaceBytes)
unpinFile
public boolean unpinFile(int fileId)
unlockFile
public boolean unlockFile(int fileId)
updateRawTableMetadata
public void updateRawTableMetadata(int id,
ByteBuffer metadata)
throws TableDoesNotExistException,
org.apache.thrift.TException
- Throws:
TableDoesNotExistException
org.apache.thrift.TException
getUnderfsAddress
public String getUnderfsAddress()
throws IOException
- Throws:
IOException
Copyright © 2013. All Rights Reserved.