public class MasterClient extends Object
| Constructor and Description |
|---|
MasterClient(InetSocketAddress masterAddress) |
MasterClient(InetSocketAddress masterAddress,
boolean useZookeeper) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCheckpoint(long workerId,
int fileId,
long length,
String checkpointPath) |
void |
cleanConnect()
Clean the connect.
|
boolean |
connect()
Try to connect to the master
|
ClientDependencyInfo |
getClientDependencyInfo(int did) |
ClientFileInfo |
getClientFileInfoById(int id) |
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,
long blockSizeByte) |
int |
user_createFileOnCheckpoint(String path,
String checkpointPath) |
long |
user_createNewBlock(int fId) |
int |
user_createRawTable(String path,
int columns,
ByteBuffer metadata) |
boolean |
user_delete(int fileId,
boolean recursive) |
boolean |
user_delete(String path,
boolean recursive) |
long |
user_getBlockId(int fId,
int index) |
ClientBlockInfo |
user_getClientBlockInfo(long blockId) |
ClientFileInfo |
user_getClientFileInfoByPath(String path) |
ClientRawTableInfo |
user_getClientRawTableInfoById(int id) |
ClientRawTableInfo |
user_getClientRawTableInfoByPath(String path) |
List<ClientBlockInfo> |
user_getFileBlocks(int id) |
int |
user_getFileId(String path) |
int |
user_getNumberOfFiles(String folderPath) |
int |
user_getRawTableId(String path) |
String |
user_getUnderfsAddress() |
NetAddress |
user_getWorker(boolean random,
String hostname) |
List<Integer> |
user_listFiles(String path,
boolean recursive) |
List<String> |
user_ls(String path,
boolean recursive) |
boolean |
user_mkdir(String path) |
void |
user_outOfMemoryForPinFile(int fileId) |
void |
user_rename(String srcPath,
String dstPath) |
void |
user_renameTo(int fId,
String path) |
void |
user_reportLostFile(int fileId) |
void |
user_requestFilesInDependency(int depId) |
void |
user_unpinFile(int id) |
void |
user_updateRawTableMetadata(int id,
ByteBuffer metadata) |
void |
worker_cacheBlock(long workerId,
long workerUsedBytes,
long blockId,
long length) |
Set<Integer> |
worker_getPinIdList() |
List<Integer> |
worker_getPriorityDependencyList() |
Command |
worker_heartbeat(long workerId,
long usedBytes,
List<Long> removedPartitionList) |
long |
worker_register(NetAddress workerNetAddress,
long totalBytes,
long usedBytes,
List<Long> currentBlockList)
Register the worker to the master.
|
public MasterClient(InetSocketAddress masterAddress)
public MasterClient(InetSocketAddress masterAddress, boolean useZookeeper)
public boolean addCheckpoint(long workerId,
int fileId,
long length,
String checkpointPath)
throws FileDoesNotExistException,
SuspectedFileSizeException,
BlockInfoException,
org.apache.thrift.TException
workerId - if -1, means the checkpoint is added directly by the client from underlayer fs.fileId - length - checkpointPath - FileDoesNotExistExceptionSuspectedFileSizeExceptionBlockInfoExceptionorg.apache.thrift.TExceptionpublic boolean connect()
public void cleanConnect()
public ClientFileInfo getClientFileInfoById(int id) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic long getUserId()
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic boolean isConnected()
public void shutdown()
public List<ClientFileInfo> listStatus(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_completeFile(int fId)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_createFile(String path, long blockSizeByte) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_createFileOnCheckpoint(String path, String checkpointPath) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic long user_createNewBlock(int fId)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_createRawTable(String path, int columns, ByteBuffer metadata) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic boolean user_delete(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic boolean user_delete(int fileId,
boolean recursive)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic long user_getBlockId(int fId,
int index)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException
FileDoesNotExistExceptionBlockInfoExceptionorg.apache.thrift.TExceptionpublic ClientFileInfo user_getClientFileInfoByPath(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_getFileId(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_getRawTableId(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic List<ClientBlockInfo> user_getFileBlocks(int id) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic NetAddress user_getWorker(boolean random, String hostname) throws NoWorkerException, org.apache.thrift.TException
NoWorkerExceptionorg.apache.thrift.TExceptionpublic ClientRawTableInfo user_getClientRawTableInfoByPath(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic ClientRawTableInfo user_getClientRawTableInfoById(int id) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic int user_getNumberOfFiles(String folderPath) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic String user_getUnderfsAddress() throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic List<Integer> user_listFiles(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic List<String> user_ls(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic boolean user_mkdir(String path) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_outOfMemoryForPinFile(int fileId)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic void user_rename(String srcPath, String dstPath) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_renameTo(int fId,
String path)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_unpinFile(int id)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_updateRawTableMetadata(int id,
ByteBuffer metadata)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void worker_cacheBlock(long workerId,
long workerUsedBytes,
long blockId,
long length)
throws FileDoesNotExistException,
SuspectedFileSizeException,
BlockInfoException,
org.apache.thrift.TException
FileDoesNotExistExceptionSuspectedFileSizeExceptionBlockInfoExceptionorg.apache.thrift.TExceptionpublic Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedPartitionList) throws BlockInfoException, org.apache.thrift.TException
BlockInfoExceptionorg.apache.thrift.TExceptionpublic Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic long worker_register(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlockList) throws BlockInfoException, org.apache.thrift.TException
workerNetAddress - Worker's NetAddresstotalBytes - Worker's capacityusedBytes - Worker's used storagecurrentBlockList - Blocks in worker's space.BlockInfoExceptionorg.apache.thrift.TExceptionpublic List<Integer> worker_getPriorityDependencyList() throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic 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, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_reportLostFile(int fileId)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic void user_requestFilesInDependency(int depId)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic ClientDependencyInfo getClientDependencyInfo(int did) throws IOException, org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionCopyright © 2014. All rights reserved.