public final class MasterClient extends Object implements Closeable
| Constructor and Description |
|---|
MasterClient(InetSocketAddress masterAddress,
boolean useZookeeper,
ExecutorService executorService) |
MasterClient(InetSocketAddress masterAddress,
ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCheckpoint(long workerId,
int fileId,
long length,
String checkpointPath) |
void |
close()
Clean the connect.
|
void |
connect()
Connects to the Tachyon Master; an exception is thrown if this fails.
|
ClientDependencyInfo |
getClientDependencyInfo(int did) |
ClientFileInfo |
getFileStatus(int fileId,
String path) |
long |
getUserId() |
List<ClientWorkerInfo> |
getWorkersInfo() |
boolean |
isConnected() |
List<ClientFileInfo> |
listStatus(String path) |
void |
shutdown() |
void |
user_completeFile(int fId) |
int |
user_createDependency(List<String> parents,
List<String> children,
String commandPrefix,
List<ByteBuffer> data,
String comment,
String framework,
String frameworkVersion,
int dependencyType,
long childrenBlockSizeByte) |
int |
user_createFile(String path,
String ufsPath,
long blockSizeByte,
boolean recursive) |
long |
user_createNewBlock(int fId) |
int |
user_createRawTable(String path,
int columns,
ByteBuffer metadata) |
boolean |
user_delete(int fileId,
String path,
boolean recursive) |
boolean |
user_freepath(int fileId,
String path,
boolean recursive) |
long |
user_getBlockId(int fId,
int index) |
ClientBlockInfo |
user_getClientBlockInfo(long blockId) |
ClientRawTableInfo |
user_getClientRawTableInfo(int id,
String path) |
List<ClientBlockInfo> |
user_getFileBlocks(int fileId,
String path) |
int |
user_getRawTableId(String path) |
String |
user_getUfsAddress() |
NetAddress |
user_getWorker(boolean random,
String hostname) |
void |
user_heartbeat() |
boolean |
user_mkdirs(String path,
boolean recursive) |
boolean |
user_rename(int fileId,
String srcPath,
String dstPath) |
void |
user_reportLostFile(int fileId) |
void |
user_requestFilesInDependency(int depId) |
void |
user_setPinned(int id,
boolean pinned) |
void |
user_updateRawTableMetadata(int id,
ByteBuffer metadata) |
void |
worker_cacheBlock(long workerId,
long workerUsedBytes,
long storageDirId,
long blockId,
long length) |
Set<Integer> |
worker_getPinIdList() |
List<Integer> |
worker_getPriorityDependencyList() |
Command |
worker_heartbeat(long workerId,
long usedBytes,
List<Long> removedBlockIds,
Map<Long,List<Long>> addedBlockIds) |
long |
worker_register(NetAddress workerNetAddress,
long totalBytes,
long usedBytes,
Map<Long,List<Long>> currentBlockList)
Register the worker to the master.
|
public MasterClient(InetSocketAddress masterAddress, ExecutorService executorService)
public MasterClient(InetSocketAddress masterAddress, boolean useZookeeper, ExecutorService executorService)
public boolean addCheckpoint(long workerId,
int fileId,
long length,
String checkpointPath)
throws IOException
workerId - if -1, means the checkpoint is added directly by the client from underlayer fs.fileId - length - checkpointPath - fileId and false otherwiseFileDoesNotExistExceptionSuspectedFileSizeExceptionBlockInfoExceptionIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void connect()
throws IOException
IOExceptionpublic ClientDependencyInfo getClientDependencyInfo(int did) throws IOException
IOExceptionpublic ClientFileInfo getFileStatus(int fileId, String path) throws IOException
IOExceptionpublic long getUserId()
throws IOException
IOExceptionpublic List<ClientWorkerInfo> getWorkersInfo() throws IOException
IOExceptionpublic boolean isConnected()
public List<ClientFileInfo> listStatus(String path) throws IOException
IOExceptionpublic void shutdown()
public void user_completeFile(int fId)
throws IOException
IOExceptionpublic int user_createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws IOException
IOExceptionpublic int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws IOException
IOExceptionpublic long user_createNewBlock(int fId)
throws IOException
IOExceptionpublic int user_createRawTable(String path, int columns, ByteBuffer metadata) throws IOException
IOExceptionpublic boolean user_delete(int fileId,
String path,
boolean recursive)
throws IOException
IOExceptionpublic long user_getBlockId(int fId,
int index)
throws IOException
IOExceptionpublic ClientBlockInfo user_getClientBlockInfo(long blockId) throws IOException
IOExceptionpublic ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws IOException
IOExceptionpublic List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws IOException
IOExceptionpublic int user_getRawTableId(String path) throws IOException
IOExceptionpublic String user_getUfsAddress() throws IOException
IOExceptionpublic NetAddress user_getWorker(boolean random, String hostname) throws NoWorkerException, IOException
NoWorkerExceptionIOExceptionpublic void user_heartbeat()
throws IOException
IOExceptionpublic boolean user_mkdirs(String path, boolean recursive) throws IOException
IOExceptionpublic boolean user_rename(int fileId,
String srcPath,
String dstPath)
throws IOException
IOExceptionpublic void user_reportLostFile(int fileId)
throws IOException
IOExceptionpublic void user_requestFilesInDependency(int depId)
throws IOException
IOExceptionpublic void user_setPinned(int id,
boolean pinned)
throws IOException
IOExceptionpublic void user_updateRawTableMetadata(int id,
ByteBuffer metadata)
throws IOException
IOExceptionpublic boolean user_freepath(int fileId,
String path,
boolean recursive)
throws IOException
IOExceptionpublic void worker_cacheBlock(long workerId,
long workerUsedBytes,
long storageDirId,
long blockId,
long length)
throws IOException,
FileDoesNotExistException,
SuspectedFileSizeException,
BlockInfoException
public Set<Integer> worker_getPinIdList() throws IOException
IOExceptionpublic List<Integer> worker_getPriorityDependencyList() throws IOException
IOExceptionpublic Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlockIds, Map<Long,List<Long>> addedBlockIds) throws IOException
IOExceptionpublic long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, Map<Long,List<Long>> currentBlockList) throws BlockInfoException, IOException
workerNetAddress - Worker's NetAddresstotalBytes - Worker's capacityusedBytes - Worker's used storagecurrentBlockList - Blocks in worker's space.BlockInfoExceptionorg.apache.thrift.TExceptionIOExceptionCopyright © 2015. All Rights Reserved.