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 otherwiseFileDoesNotExistException
SuspectedFileSizeException
BlockInfoException
IOException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void connect() throws IOException
IOException
public ClientDependencyInfo getClientDependencyInfo(int did) throws IOException
IOException
public ClientFileInfo getFileStatus(int fileId, String path) throws IOException
IOException
public long getUserId() throws IOException
IOException
public List<ClientWorkerInfo> getWorkersInfo() throws IOException
IOException
public boolean isConnected()
public List<ClientFileInfo> listStatus(String path) throws IOException
IOException
public void shutdown()
public void user_completeFile(int fId) throws IOException
IOException
public 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
IOException
public int user_createFile(String path, String ufsPath, long blockSizeByte, boolean recursive) throws IOException
IOException
public long user_createNewBlock(int fId) throws IOException
IOException
public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws IOException
IOException
public boolean user_delete(int fileId, String path, boolean recursive) throws IOException
IOException
public long user_getBlockId(int fId, int index) throws IOException
IOException
public ClientBlockInfo user_getClientBlockInfo(long blockId) throws IOException
IOException
public ClientRawTableInfo user_getClientRawTableInfo(int id, String path) throws IOException
IOException
public List<ClientBlockInfo> user_getFileBlocks(int fileId, String path) throws IOException
IOException
public int user_getRawTableId(String path) throws IOException
IOException
public String user_getUfsAddress() throws IOException
IOException
public NetAddress user_getWorker(boolean random, String hostname) throws NoWorkerException, IOException
NoWorkerException
IOException
public void user_heartbeat() throws IOException
IOException
public boolean user_mkdirs(String path, boolean recursive) throws IOException
IOException
public boolean user_rename(int fileId, String srcPath, String dstPath) throws IOException
IOException
public void user_reportLostFile(int fileId) throws IOException
IOException
public void user_requestFilesInDependency(int depId) throws IOException
IOException
public void user_setPinned(int id, boolean pinned) throws IOException
IOException
public void user_updateRawTableMetadata(int id, ByteBuffer metadata) throws IOException
IOException
public boolean user_freepath(int fileId, String path, boolean recursive) throws IOException
IOException
public 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
IOException
public List<Integer> worker_getPriorityDependencyList() throws IOException
IOException
public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedBlockIds, Map<Long,List<Long>> addedBlockIds) throws IOException
IOException
public 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.BlockInfoException
org.apache.thrift.TException
IOException
Copyright © 2015. All Rights Reserved.