public class MasterWorkerInfo extends Object
Modifier and Type | Field and Description |
---|---|
NetAddress |
mWorkerAddress
Worker's address
|
Constructor and Description |
---|
MasterWorkerInfo(long id,
NetAddress address,
long capacityBytes) |
Modifier and Type | Method and Description |
---|---|
ClientWorkerInfo |
generateClientWorkerInfo() |
NetAddress |
getAddress() |
long |
getAvailableBytes() |
Set<Long> |
getBlocks() |
long |
getCapacityBytes() |
long |
getId() |
long |
getLastUpdatedTimeMs() |
List<Long> |
getToRemovedBlocks() |
long |
getUsedBytes() |
String |
toString() |
void |
updateBlock(boolean add,
long blockId)
Adds or removes a block from the worker
|
void |
updateBlocks(boolean add,
Collection<Long> blockIds)
Adds or removes blocks from the worker
|
void |
updateLastUpdatedTimeMs()
Updates the last updated time of the worker in ms
|
void |
updateToRemovedBlock(boolean add,
long blockId)
Adds or removes a block from the to-be-removed blocks set of the worker.
|
void |
updateToRemovedBlocks(boolean add,
Collection<Long> blockIds)
Adds or removes blocks from the to-be-removed blocks set of the worker.
|
void |
updateUsedBytes(long usedBytes)
Set the used space of the worker in bytes.
|
public final NetAddress mWorkerAddress
public MasterWorkerInfo(long id, NetAddress address, long capacityBytes)
public ClientWorkerInfo generateClientWorkerInfo()
ClientWorkerInfo
for this workerpublic NetAddress getAddress()
public long getAvailableBytes()
public long getCapacityBytes()
public long getId()
public long getLastUpdatedTimeMs()
public List<Long> getToRemovedBlocks()
public long getUsedBytes()
public void updateBlock(boolean add, long blockId)
add
- true if to add, to remove otherwise.blockId
- the ID of the block to be added or removedpublic void updateBlocks(boolean add, Collection<Long> blockIds)
add
- true if to add, to remove otherwise.blockIds
- IDs of the blocks to be added or removedpublic void updateLastUpdatedTimeMs()
public void updateToRemovedBlock(boolean add, long blockId)
add
- true if to add, to remove otherwise.blockId
- the ID of the block to be added or removedpublic void updateToRemovedBlocks(boolean add, Collection<Long> blockIds)
add
- true if to add, to remove otherwise.blockIds
- IDs of blocks to be added or removedpublic void updateUsedBytes(long usedBytes)
usedBytes
- the used space in bytesCopyright © 2015. All Rights Reserved.