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
|
long |
getUserId() |
List<ClientWorkerInfo> |
getWorkersInfo() |
boolean |
isConnected() |
List<ClientFileInfo> |
listStatus(String path) |
void |
shutdown() |
void |
user_completeFile(int fId) |
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_getClientFileInfoById(int id) |
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_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() |
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
- FileDoesNotExistException
SuspectedFileSizeException
BlockInfoException
org.apache.thrift.TException
public boolean connect()
public void cleanConnect()
public long getUserId() throws org.apache.thrift.TException
org.apache.thrift.TException
public List<ClientWorkerInfo> getWorkersInfo() throws org.apache.thrift.TException
org.apache.thrift.TException
public boolean isConnected()
public void shutdown()
public List<ClientFileInfo> listStatus(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void user_completeFile(int fId) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_createFile(String path, long blockSizeByte) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_createFileOnCheckpoint(String path, String checkpointPath) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public long user_createNewBlock(int fId) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public boolean user_delete(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public boolean user_delete(int fileId, boolean recursive) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public long user_getBlockId(int fId, int index) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, BlockInfoException, org.apache.thrift.TException
FileDoesNotExistException
BlockInfoException
org.apache.thrift.TException
public ClientFileInfo user_getClientFileInfoByPath(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public ClientFileInfo user_getClientFileInfoById(int id) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_getFileId(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_getRawTableId(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public List<ClientBlockInfo> user_getFileBlocks(int id) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public NetAddress user_getWorker(boolean random, String hostname) throws NoWorkerException, org.apache.thrift.TException
NoWorkerException
org.apache.thrift.TException
public ClientRawTableInfo user_getClientRawTableInfoByPath(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public ClientRawTableInfo user_getClientRawTableInfoById(int id) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public int user_getNumberOfFiles(String folderPath) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public String user_getUnderfsAddress() throws org.apache.thrift.TException
org.apache.thrift.TException
public List<Integer> user_listFiles(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public List<String> user_ls(String path, boolean recursive) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public boolean user_mkdir(String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void user_outOfMemoryForPinFile(int fileId) throws org.apache.thrift.TException
org.apache.thrift.TException
public void user_rename(String srcPath, String dstPath) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void user_renameTo(int fId, String path) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void user_unpinFile(int id) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void user_updateRawTableMetadata(int id, ByteBuffer metadata) throws IOException, org.apache.thrift.TException
IOException
org.apache.thrift.TException
public void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException
FileDoesNotExistException
SuspectedFileSizeException
BlockInfoException
org.apache.thrift.TException
public Command worker_heartbeat(long workerId, long usedBytes, List<Long> removedPartitionList) throws BlockInfoException, org.apache.thrift.TException
BlockInfoException
org.apache.thrift.TException
public Set<Integer> worker_getPinIdList() throws org.apache.thrift.TException
org.apache.thrift.TException
public 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.BlockInfoException
org.apache.thrift.TException
Copyright © 2013. All rights reserved.