@NotThreadSafe public final class MasterBlockInfo extends 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,
String tierAlias)
Adds a location of the block.
|
long |
getBlockId() |
List<MasterBlockLocation> |
getBlockLocations()
Gets the net addresses for all workers which have the block's data in their tiered storage.
|
long |
getLength() |
int |
getNumLocations() |
Set<Long> |
getWorkers() |
boolean |
isInTier(String targetTierAlias) |
void |
removeWorker(long workerId)
Removes the worker from the locations of this block.
|
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, 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 int getNumLocations()
public List<MasterBlockLocation> getBlockLocations()
public boolean isInTier(String targetTierAlias)
targetTierAlias
- the tier alias to targetCopyright © 2023. All Rights Reserved.