public class WorkerStorage extends Object
Constructor and Description |
---|
WorkerStorage(InetSocketAddress masterAddress,
InetSocketAddress workerAddress,
String dataFolder,
long memoryCapacityBytes) |
Modifier and Type | Method and Description |
---|---|
void |
accessBlock(long blockId) |
void |
addCheckpoint(long userId,
int fileId) |
void |
cacheBlock(long userId,
long blockId) |
void |
checkStatus()
Check worker's status.
|
void |
freeBlocks(List<Long> blocks)
Remove blocks from the memory.
|
String |
getDataFolder() |
String |
getUserTempFolder(long userId) |
String |
getUserUnderfsTempFolder(long userId) |
Command |
heartbeat() |
void |
lockBlock(long blockId,
long userId) |
void |
register() |
boolean |
requestSpace(long userId,
long requestBytes) |
void |
resetMasterClient() |
void |
returnSpace(long userId,
long returnedBytes) |
void |
stop() |
void |
unlockBlock(long blockId,
long userId) |
void |
userHeartbeat(long userId) |
public WorkerStorage(InetSocketAddress masterAddress, InetSocketAddress workerAddress, String dataFolder, long memoryCapacityBytes)
public void accessBlock(long blockId)
public void addCheckpoint(long userId, int fileId) throws FileDoesNotExistException, SuspectedFileSizeException, FailedToCheckpointException, BlockInfoException, org.apache.thrift.TException
FileDoesNotExistException
SuspectedFileSizeException
FailedToCheckpointException
BlockInfoException
org.apache.thrift.TException
public void cacheBlock(long userId, long blockId) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException
FileDoesNotExistException
SuspectedFileSizeException
BlockInfoException
org.apache.thrift.TException
public void checkStatus()
It finds the timeout users and cleans them up.
public void freeBlocks(List<Long> blocks)
blocks
- The list of blocks to be removed.public String getDataFolder() throws org.apache.thrift.TException
org.apache.thrift.TException
public String getUserTempFolder(long userId) throws org.apache.thrift.TException
org.apache.thrift.TException
public String getUserUnderfsTempFolder(long userId) throws org.apache.thrift.TException
org.apache.thrift.TException
public Command heartbeat() throws BlockInfoException, org.apache.thrift.TException
BlockInfoException
org.apache.thrift.TException
public void lockBlock(long blockId, long userId) throws org.apache.thrift.TException
org.apache.thrift.TException
public void register()
public void returnSpace(long userId, long returnedBytes) throws org.apache.thrift.TException
org.apache.thrift.TException
public boolean requestSpace(long userId, long requestBytes) throws org.apache.thrift.TException
org.apache.thrift.TException
public void resetMasterClient()
public void stop()
public void unlockBlock(long blockId, long userId) throws org.apache.thrift.TException
org.apache.thrift.TException
public void userHeartbeat(long userId) throws org.apache.thrift.TException
org.apache.thrift.TException
Copyright © 2013. All rights reserved.