@NotThreadSafe
public final class MasterBlockInfo
extends java.lang.Object
| Constructor and Description |
|---|
MasterBlockInfo(long blockId,
long length)
Creates a new instance of
MasterBlockInfo. |
| Modifier and Type | Method and Description |
|---|---|
void |
addWorker(long workerId,
java.lang.String tierAlias)
Adds a location of the block.
|
long |
getBlockId() |
java.util.List<MasterBlockLocation> |
getBlockLocations()
Gets the net addresses for all workers which have the block's data in their tiered storage.
|
long |
getLength() |
int |
getNumLocations() |
java.util.Set<java.lang.Long> |
getWorkers() |
boolean |
isInTier(java.lang.String targetTierAlias) |
void |
removeWorker(long workerId)
Removes the worker from the locations of this block.
|
java.lang.String |
toString() |
void |
updateLength(long length)
Updates the length, if and only if the length was previously unknown.
|
public MasterBlockInfo(long blockId,
long length)
MasterBlockInfo.blockId - the block id to uselength - the block length in bytes to usepublic long getLength()
public void updateLength(long length)
length - the updated lengthpublic long getBlockId()
public void addWorker(long workerId,
java.lang.String tierAlias)
workerId - the id of the workertierAlias - the alias of the storage tier that this block is onpublic void removeWorker(long workerId)
workerId - the worker id to removepublic java.util.Set<java.lang.Long> getWorkers()
public int getNumLocations()
public java.util.List<MasterBlockLocation> getBlockLocations()
public boolean isInTier(java.lang.String targetTierAlias)
targetTierAlias - the tier alias to targetpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2019. All Rights Reserved.