public class MasterInfo extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
MasterInfo.MasterInfoHeartbeatExecutor
Master info periodical status check.
|
class |
MasterInfo.RecomputationScheduler |
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.
|
int |
cacheBlock(long workerId,
long workerUsedBytes,
long blockId,
long length)
A worker cache a block in its memory.
|
void |
completeFile(int fileId) |
int |
createDependency(List<String> parents,
List<String> children,
String commandPrefix,
List<ByteBuffer> data,
String comment,
String framework,
String frameworkVersion,
DependencyType dependencyType) |
int |
createFile(boolean recursive,
String path,
boolean directory,
int columns,
ByteBuffer metadata,
long blockSizeByte)
Create a file.
|
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 based on the file's ID.
|
boolean |
delete(String path,
boolean recursive)
Delete a file based on the file's path.
|
long |
getBlockIdBasedOnOffset(int fileId,
long offset) |
List<BlockInfo> |
getBlockList(String path)
Get the list of blocks of an InodeFile determined by path.
|
long |
getCapacityBytes()
Get the capacity of the whole system.
|
ClientBlockInfo |
getClientBlockInfo(long blockId) |
ClientDependencyInfo |
getClientDependencyInfo(int dependencyId) |
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.
|
Journal |
getJournal()
Get Journal instance for MasterInfo for Unit test only
|
InetSocketAddress |
getMasterAddress() |
long |
getNewUserId() |
int |
getNumberOfFiles(String path) |
List<Integer> |
getPinIdList() |
List<String> |
getPinList() |
List<Integer> |
getPriorityDependencyList() |
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() |
void |
init() |
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 |
reportLostFile(int fileId) |
void |
requestFilesInDependency(int depId) |
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
IOExceptionpublic void init()
throws IOException
IOExceptionpublic 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.FileNotFoundExceptionSuspectedFileSizeExceptionBlockInfoExceptionpublic int cacheBlock(long workerId,
long workerUsedBytes,
long blockId,
long length)
throws FileDoesNotExistException,
SuspectedFileSizeException,
BlockInfoException
workerId - workerUsedBytes - blockId - length - FileDoesNotExistExceptionSuspectedFileSizeExceptionBlockInfoExceptionpublic int createDependency(List<String> parents, List<String> children, String commandPrefix, List<ByteBuffer> data, String comment, String framework, String frameworkVersion, DependencyType dependencyType) throws InvalidPathException, FileDoesNotExistException
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
recursive - path - directory - columns - metadata - blockSizeByte - FileAlreadyExistExceptionInvalidPathExceptionBlockInfoExceptionTachyonExceptionpublic void createImage(DataOutputStream os) throws IOException
IOExceptionpublic void loadImage(DataInputStream is) throws IOException
is. Assume this blocks the whole
MasterInfo.is - the inputstream to load the image.IOExceptionpublic long createNewBlock(int fileId)
throws FileDoesNotExistException
FileDoesNotExistExceptionpublic void completeFile(int fileId)
throws FileDoesNotExistException
FileDoesNotExistExceptionpublic 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.TachyonExceptionpublic boolean delete(String path, boolean recursive) throws TachyonException
path - The file to be deleted.recursive - whether delete the file recursively or not.TachyonExceptionpublic List<BlockInfo> getBlockList(String path) throws InvalidPathException, FileDoesNotExistException
path - The file.InvalidPathExceptionFileDoesNotExistExceptionpublic long getBlockIdBasedOnOffset(int fileId,
long offset)
throws FileDoesNotExistException
FileDoesNotExistExceptionpublic long getCapacityBytes()
public ClientDependencyInfo getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException
DependencyDoesNotExistExceptionpublic ClientBlockInfo getClientBlockInfo(long blockId) throws FileDoesNotExistException, IOException, BlockInfoException
public ClientFileInfo getClientFileInfo(int fid) throws FileDoesNotExistException
FileDoesNotExistExceptionpublic ClientFileInfo getClientFileInfo(String path) throws FileDoesNotExistException, InvalidPathException
public ClientRawTableInfo getClientRawTableInfo(int id) throws TableDoesNotExistException
TableDoesNotExistExceptionpublic 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 pathFileDoesNotExistExceptionInvalidPathExceptionpublic String getFileNameById(int fileId) throws FileDoesNotExistException
FileDoesNotExistExceptionpublic List<ClientBlockInfo> getFileLocations(int fileId) throws FileDoesNotExistException, IOException
FileDoesNotExistExceptionIOExceptionpublic List<ClientBlockInfo> getFileLocations(String path) throws FileDoesNotExistException, InvalidPathException, IOException
public int getFileId(String path) throws InvalidPathException
path - The path of the fileInvalidPathExceptionpublic List<String> getInMemoryFiles()
public InetSocketAddress getMasterAddress()
public long getNewUserId()
public int getNumberOfFiles(String path) throws InvalidPathException, FileDoesNotExistException
public int getRawTableId(String path) throws InvalidPathException
InvalidPathExceptionpublic long getStarttimeMs()
public long getUnderFsCapacityBytes()
throws IOException
IOExceptionpublic long getUnderFsUsedBytes()
throws IOException
IOExceptionpublic long getUnderFsFreeBytes()
throws IOException
IOExceptionpublic 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
BlockInfoExceptionpublic void rename(int fileId,
String dstPath)
throws FileDoesNotExistException,
FileAlreadyExistException,
InvalidPathException
public void rename(String srcPath, String dstPath) throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException
public void reportLostFile(int fileId)
public void requestFilesInDependency(int depId)
public void unpinFile(int fileId)
throws FileDoesNotExistException
FileDoesNotExistExceptionpublic void updateRawTableMetadata(int tableId,
ByteBuffer metadata)
throws TableDoesNotExistException,
TachyonException
public Command workerHeartbeat(long workerId, long usedBytes, List<Long> removedBlockIds) throws BlockInfoException
BlockInfoExceptionpublic void stop()
public Journal getJournal()
Copyright © 2014. All rights reserved.