public class WorkerClient extends Object
Constructor and Description |
---|
WorkerClient(InetSocketAddress address,
long userId) |
Modifier and Type | Method and Description |
---|---|
void |
accessBlock(long blockId)
Update the latest block access time on the worker.
|
void |
addCheckpoint(long userId,
int fileId)
Notify the worker that the checkpoint file of the file has been added.
|
boolean |
asyncCheckpoint(int fid)
Notify the worker to checkpoint the file asynchronously.
|
void |
cacheBlock(long userId,
long blockId)
Notify the worker the block is cached.
|
void |
close()
Close the connection to worker.
|
String |
getDataFolder() |
String |
getUserTempFolder(long userId)
Get the local user temporary folder of the specified user.
|
String |
getUserUnderfsTempFolder(long userId)
Get the user temporary folder in the under file system of the specified user.
|
boolean |
isConnected() |
void |
lockBlock(long blockId,
long userId)
Lock the block, therefore, the worker will lock evict the block from the memory untill it is
unlocked.
|
boolean |
open()
Open the connection to the worker.
|
boolean |
requestSpace(long userId,
long requestBytes)
Request space from the worker's memory
|
void |
returnSpace(long userId,
long returnSpaceBytes)
Return the space which has been requested
|
void |
unlockBlock(long blockId,
long userId)
Unlock the block
|
void |
userHeartbeat(long userId)
Users' heartbeat to the Worker.
|
public WorkerClient(InetSocketAddress address, long userId)
address
- The address of the worker the client trying to contect to.userId
- The user id of the clientpublic void accessBlock(long blockId) throws org.apache.thrift.TException
blockId
- The id of the blockorg.apache.thrift.TException
public void addCheckpoint(long userId, int fileId) throws IOException, org.apache.thrift.TException
userId
- The user id of the client who send the notificationfileId
- The id of the checkpointed fileIOException
org.apache.thrift.TException
public boolean asyncCheckpoint(int fid) throws TachyonException, org.apache.thrift.TException
fid
- The id of the fileTachyonException
org.apache.thrift.TException
public void cacheBlock(long userId, long blockId) throws IOException, org.apache.thrift.TException
userId
- The user id of the client who send the notificationblockId
- The id of the blockIOException
org.apache.thrift.TException
public void close()
public String getDataFolder() throws org.apache.thrift.TException
org.apache.thrift.TException
public String getUserTempFolder(long userId) throws org.apache.thrift.TException
userId
- The id of the userorg.apache.thrift.TException
public String getUserUnderfsTempFolder(long userId) throws org.apache.thrift.TException
userId
- The id of the userorg.apache.thrift.TException
public boolean isConnected()
public void lockBlock(long blockId, long userId) throws org.apache.thrift.TException
blockId
- The id of the blockuserId
- The id of the user who wants to lock the blockorg.apache.thrift.TException
public boolean open()
public boolean requestSpace(long userId, long requestBytes) throws org.apache.thrift.TException
userId
- The id of the user who send the requestrequestBytes
- The requested space size, in bytesorg.apache.thrift.TException
public void returnSpace(long userId, long returnSpaceBytes) throws org.apache.thrift.TException
userId
- The id of the user who wants to return the spacereturnSpaceBytes
- The returned space size, in bytesorg.apache.thrift.TException
public void unlockBlock(long blockId, long userId) throws org.apache.thrift.TException
blockId
- The id of the blockuserId
- The id of the user who wants to unlock the blockorg.apache.thrift.TException
public void userHeartbeat(long userId) throws org.apache.thrift.TException
userId
- The id of the userorg.apache.thrift.TException
Copyright © 2014. All rights reserved.