java.lang.Comparable<org.apache.hadoop.hdfs.protocol.Block>, org.apache.hadoop.io.Writable, org.apache.hadoop.util.LightWeightGSet.LinkedElement@Private public class BlockInfoStriped extends BlockInfo
BlockInfo, presenting a block group in erasure coding.
We still use triplets to store DatanodeStorageInfo for each block in the
block group, as well as the previous/next block in the corresponding
DatanodeStorageInfo. For a (m+k) block group, the first (m+k) triplet units
are sorted and strictly mapped to the corresponding block.
Normally each block belonging to group is stored in only one DataNode.
However, it is possible that some block is over-replicated. Thus the triplet
array's size can be larger than (m+k). Thus currently we use an extra byte
array to record the block index for each triplet.| Modifier and Type | Class | Description |
|---|---|---|
static class |
BlockInfoStriped.StorageAndBlockIndex |
This class contains datanode storage information and block index in the
block group.
|
EMPTY_ARRAY, triplets| Constructor | Description |
|---|---|
BlockInfoStriped(org.apache.hadoop.hdfs.protocol.Block blk,
org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy ecPolicy) |
| Modifier and Type | Method | Description |
|---|---|---|
org.apache.hadoop.hdfs.protocol.BlockType |
getBlockType() |
|
int |
getCellSize() |
|
short |
getDataBlockNum() |
|
org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy |
getErasureCodingPolicy() |
|
short |
getParityBlockNum() |
|
short |
getRealDataBlockNum() |
If the block is committed/completed and its length is less than a full
stripe, it returns the the number of actual data blocks.
|
short |
getRealTotalBlockNum() |
|
java.lang.Iterable<BlockInfoStriped.StorageAndBlockIndex> |
getStorageAndIndexInfos() |
|
byte |
getStorageBlockIndex(DatanodeStorageInfo storage) |
|
short |
getTotalBlockNum() |
|
boolean |
isStriped() |
|
int |
numNodes() |
Count the number of data-nodes the block currently belongs to (i.e., NN
has received block reports from the DN).
|
long |
spaceConsumed() |
convertToBlockUnderConstruction, delete, equals, getBlockCollectionId, getBlockUCState, getCapacity, getDatanode, getNext, getReplication, getStorageInfos, getUnderConstructionFeature, hashCode, isComplete, isCompleteOrCommitted, isDeleted, isUnderRecovery, moveBlockToHead, setBlockCollectionId, setGenerationStampAndVerifyReplicas, setNext, setReplicationappendStringTo, compareTo, filename2id, getBlockId, getBlockId, getBlockName, getGenerationStamp, getGenerationStamp, getNumBytes, isBlockFilename, isMetaFilename, matchingIdAndGenStamp, metaToBlockFile, readFields, readId, set, setBlockId, setGenerationStamp, setNumBytes, toString, toString, write, writeIdpublic BlockInfoStriped(org.apache.hadoop.hdfs.protocol.Block blk,
org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy ecPolicy)
public short getTotalBlockNum()
public short getDataBlockNum()
public short getParityBlockNum()
public int getCellSize()
public short getRealDataBlockNum()
public short getRealTotalBlockNum()
public org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy getErasureCodingPolicy()
@VisibleForTesting public byte getStorageBlockIndex(DatanodeStorageInfo storage)
public long spaceConsumed()
public org.apache.hadoop.hdfs.protocol.BlockType getBlockType()
getBlockType in class BlockInfopublic int numNodes()
BlockInfopublic java.lang.Iterable<BlockInfoStriped.StorageAndBlockIndex> getStorageAndIndexInfos()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.