public class WorkerStorage extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
WorkerStorage.CheckpointThread |
| 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) |
boolean |
asyncCheckpoint(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 |
getUnderfsOrphansFolder() |
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
FileDoesNotExistExceptionSuspectedFileSizeExceptionFailedToCheckpointExceptionBlockInfoExceptionorg.apache.thrift.TExceptionpublic void cacheBlock(long userId,
long blockId)
throws FileDoesNotExistException,
SuspectedFileSizeException,
BlockInfoException,
org.apache.thrift.TException
FileDoesNotExistExceptionSuspectedFileSizeExceptionBlockInfoExceptionorg.apache.thrift.TExceptionpublic 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.TExceptionpublic String getUserTempFolder(long userId) throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic String getUserUnderfsTempFolder(long userId) throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic Command heartbeat() throws BlockInfoException, org.apache.thrift.TException
BlockInfoExceptionorg.apache.thrift.TExceptionpublic void lockBlock(long blockId,
long userId)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic void register()
public void returnSpace(long userId,
long returnedBytes)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic boolean requestSpace(long userId,
long requestBytes)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic void resetMasterClient()
public void stop()
public void unlockBlock(long blockId,
long userId)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic void userHeartbeat(long userId)
throws org.apache.thrift.TException
org.apache.thrift.TExceptionpublic boolean asyncCheckpoint(int fileId)
throws IOException,
org.apache.thrift.TException
IOExceptionorg.apache.thrift.TExceptionpublic String getUnderfsOrphansFolder()
Copyright © 2014. All rights reserved.