public class MasterInfo extends Object
Modifier and Type | Class and Description |
---|---|
class |
MasterInfo.MasterInfoHeartbeatExecutor
Master info periodical status check.
|
class |
MasterInfo.RecomputeCmd |
Constructor and Description |
---|
MasterInfo(InetSocketAddress address,
Journal journal) |
Modifier and Type | Method and Description |
---|---|
boolean |
addCheckpoint(long workerId,
int fileId,
long length,
String checkpointPath)
Add a checkpoint to a file.
|
void |
cacheBlock(long workerId,
long workerUsedBytes,
long blockId,
long length)
A worker cache a block in its memory.
|
void |
completeFile(int fileId) |
int |
createFile(boolean recursive,
String path,
boolean directory,
int columns,
ByteBuffer metadata,
long blockSizeByte) |
int |
createFile(String path,
long blockSizeByte) |
void |
createImage(DataOutputStream os) |
long |
createNewBlock(int fileId) |
int |
createRawTable(String path,
int columns,
ByteBuffer metadata) |
boolean |
delete(int fileId,
boolean recursive)
Delete a file.
|
boolean |
delete(String path,
boolean recursive) |
long |
getBlockIdBasedOnOffset(int fileId,
long offset) |
long |
getCapacityBytes() |
ClientBlockInfo |
getClientBlockInfo(long blockId) |
ClientFileInfo |
getClientFileInfo(int fid) |
ClientFileInfo |
getClientFileInfo(String path) |
ClientRawTableInfo |
getClientRawTableInfo(int id) |
ClientRawTableInfo |
getClientRawTableInfo(String path) |
int |
getFileId(String path)
Get the file id of the file.
|
List<ClientBlockInfo> |
getFileLocations(int fileId) |
List<ClientBlockInfo> |
getFileLocations(String path) |
String |
getFileNameById(int fileId) |
List<ClientFileInfo> |
getFilesInfo(String path)
If the
path is a directory, return all the direct entries in it. |
List<String> |
getInMemoryFiles()
Get absolute paths of all in memory files.
|
InetSocketAddress |
getMasterAddress() |
long |
getNewUserId() |
int |
getNumberOfFiles(String path) |
List<Integer> |
getPinIdList() |
List<String> |
getPinList() |
int |
getRawTableId(String path) |
long |
getStarttimeMs() |
long |
getUnderFsCapacityBytes() |
long |
getUnderFsFreeBytes() |
long |
getUnderFsUsedBytes() |
long |
getUsedBytes() |
List<String> |
getWhiteList() |
NetAddress |
getWorker(boolean random,
String host) |
int |
getWorkerCount() |
List<ClientWorkerInfo> |
getWorkersInfo() |
List<Integer> |
listFiles(String path,
boolean recursive) |
void |
loadImage(DataInputStream is)
Load the image from
is . |
List<String> |
ls(String path,
boolean recursive) |
boolean |
mkdir(String path) |
long |
registerWorker(NetAddress workerNetAddress,
long totalBytes,
long usedBytes,
List<Long> currentBlockIds) |
void |
rename(int fileId,
String dstPath) |
void |
rename(String srcPath,
String dstPath) |
void |
stop() |
void |
unpinFile(int fileId) |
void |
updateRawTableMetadata(int tableId,
ByteBuffer metadata) |
Command |
workerHeartbeat(long workerId,
long usedBytes,
List<Long> removedBlockIds) |
public static final String COL
public MasterInfo(InetSocketAddress address, Journal journal) throws IOException
IOException
public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) throws FileNotFoundException, SuspectedFileSizeException, BlockInfoException
workerId
- The worker which submitted the request. -1 if the request is not from a worker.fileId
- The file to add the checkpoint.length
- The length of the checkpoint.checkpointPath
- The path of the checkpoint.FileNotFoundException
SuspectedFileSizeException
BlockInfoException
public void cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException
workerId
- workerUsedBytes
- blockId
- length
- FileDoesNotExistException
SuspectedFileSizeException
BlockInfoException
public int createFile(String path, long blockSizeByte) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException
public int createFile(boolean recursive, String path, boolean directory, int columns, ByteBuffer metadata, long blockSizeByte) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException
public void createImage(DataOutputStream os) throws IOException
IOException
public void loadImage(DataInputStream is) throws IOException
is
. Assume this blocks the whole MasterInfo.is
- the inputstream to load the image.IOException
public long createNewBlock(int fileId) throws FileDoesNotExistException
FileDoesNotExistException
public void completeFile(int fileId) throws FileDoesNotExistException
FileDoesNotExistException
public int createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException
public boolean delete(int fileId, boolean recursive) throws TachyonException
fileId
- The file to be deleted.recursive
- whether delete the file recursively or not.TachyonException
public boolean delete(String path, boolean recursive) throws TachyonException
TachyonException
public long getBlockIdBasedOnOffset(int fileId, long offset) throws FileDoesNotExistException
FileDoesNotExistException
public long getCapacityBytes()
public ClientBlockInfo getClientBlockInfo(long blockId) throws FileDoesNotExistException, IOException, BlockInfoException
public ClientFileInfo getClientFileInfo(int fid) throws FileDoesNotExistException
FileDoesNotExistException
public ClientFileInfo getClientFileInfo(String path) throws FileDoesNotExistException, InvalidPathException
public ClientRawTableInfo getClientRawTableInfo(int id) throws TableDoesNotExistException
TableDoesNotExistException
public ClientRawTableInfo getClientRawTableInfo(String path) throws TableDoesNotExistException, InvalidPathException
public List<ClientFileInfo> getFilesInfo(String path) throws FileDoesNotExistException, InvalidPathException
path
is a directory, return all the direct entries in it. If the
path
is a file, return its ClientFileInfo.path
- the target directory/file pathFileDoesNotExistException
InvalidPathException
public String getFileNameById(int fileId) throws FileDoesNotExistException
FileDoesNotExistException
public List<ClientBlockInfo> getFileLocations(int fileId) throws FileDoesNotExistException, IOException
FileDoesNotExistException
IOException
public List<ClientBlockInfo> getFileLocations(String path) throws FileDoesNotExistException, InvalidPathException, IOException
public int getFileId(String path) throws InvalidPathException
path
- The path of the fileInvalidPathException
public List<String> getInMemoryFiles()
public InetSocketAddress getMasterAddress()
public long getNewUserId()
public int getNumberOfFiles(String path) throws InvalidPathException, FileDoesNotExistException
public int getRawTableId(String path) throws InvalidPathException
InvalidPathException
public long getStarttimeMs()
public long getUnderFsCapacityBytes() throws IOException
IOException
public long getUnderFsUsedBytes() throws IOException
IOException
public long getUnderFsFreeBytes() throws IOException
IOException
public long getUsedBytes()
public NetAddress getWorker(boolean random, String host)
public int getWorkerCount()
public List<ClientWorkerInfo> getWorkersInfo()
public List<Integer> listFiles(String path, boolean recursive) throws InvalidPathException, FileDoesNotExistException
public List<String> ls(String path, boolean recursive) throws InvalidPathException, FileDoesNotExistException
public boolean mkdir(String path) throws FileAlreadyExistException, InvalidPathException, TachyonException
public long registerWorker(NetAddress workerNetAddress, long totalBytes, long usedBytes, List<Long> currentBlockIds) throws BlockInfoException
BlockInfoException
public void rename(int fileId, String dstPath) throws FileDoesNotExistException, FileAlreadyExistException, InvalidPathException
public void rename(String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException
public void unpinFile(int fileId) throws FileDoesNotExistException
FileDoesNotExistException
public void updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException
public Command workerHeartbeat(long workerId, long usedBytes, List<Long> removedBlockIds) throws BlockInfoException
BlockInfoException
public void stop()
Copyright © 2013. All rights reserved.