public class BlockUnderConstructionFeature extends Object
Constructor and Description |
---|
BlockUnderConstructionFeature(org.apache.hadoop.hdfs.protocol.Block blk,
HdfsServerConstants.BlockUCState state,
DatanodeStorageInfo[] targets,
org.apache.hadoop.hdfs.protocol.BlockType blockType) |
Modifier and Type | Method and Description |
---|---|
void |
appendUCPartsConcise(StringBuilder sb) |
byte[] |
getBlockIndices() |
long |
getBlockRecoveryId() |
HdfsServerConstants.BlockUCState |
getBlockUCState()
Return the state of the block under construction.
|
DatanodeStorageInfo[] |
getExpectedStorageLocations()
Create array of expected replica locations
(as has been assigned by chooseTargets()).
|
Iterator<DatanodeStorageInfo> |
getExpectedStorageLocationsIterator()
Note that this iterator doesn't guarantee thread-safe.
|
int |
getNumExpectedLocations() |
org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo |
getTruncateBlock()
Get recover block
|
void |
initializeBlockRecovery(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo blockInfo,
long recoveryId,
boolean startRecovery)
Initialize lease recovery for this block.
|
void |
setExpectedLocations(org.apache.hadoop.hdfs.protocol.Block block,
DatanodeStorageInfo[] targets,
org.apache.hadoop.hdfs.protocol.BlockType blockType)
Set expected locations
|
void |
setTruncateBlock(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo recoveryBlock) |
String |
toString() |
public BlockUnderConstructionFeature(org.apache.hadoop.hdfs.protocol.Block blk, HdfsServerConstants.BlockUCState state, DatanodeStorageInfo[] targets, org.apache.hadoop.hdfs.protocol.BlockType blockType)
public void setExpectedLocations(org.apache.hadoop.hdfs.protocol.Block block, DatanodeStorageInfo[] targets, org.apache.hadoop.hdfs.protocol.BlockType blockType)
public DatanodeStorageInfo[] getExpectedStorageLocations()
public Iterator<DatanodeStorageInfo> getExpectedStorageLocationsIterator()
public byte[] getBlockIndices()
public int getNumExpectedLocations()
public HdfsServerConstants.BlockUCState getBlockUCState()
HdfsServerConstants.BlockUCState
public long getBlockRecoveryId()
public org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo getTruncateBlock()
public void setTruncateBlock(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo recoveryBlock)
public void initializeBlockRecovery(org.apache.hadoop.hdfs.server.blockmanagement.BlockInfo blockInfo, long recoveryId, boolean startRecovery)
blockInfo
- Block to be recoveredrecoveryId
- Recovery ID (new gen stamp)startRecovery
- Issue recovery command to datanode if true.public void appendUCPartsConcise(StringBuilder sb)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.