Class BlockGrouper
java.lang.Object
org.apache.hadoop.io.erasurecode.grouper.BlockGrouper
As part of a codec, to handle how to form a block group for encoding
and provide instructions on how to recover erased blocks from a block group
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleananyRecoverable(ECBlockGroup blockGroup) Given a BlockGroup, tell if any of the missing blocks can be recovered, to be called by ECManagerintGet required data blocks count in a BlockGroup.intGet required parity blocks count in a BlockGroup.protected ECSchemaGet EC schema.makeBlockGroup(ECBlock[] dataBlocks, ECBlock[] parityBlocks) Calculating and organizing BlockGroup, to be called by ECManagervoidSet EC schema.
-
Constructor Details
-
BlockGrouper
public BlockGrouper()
-
-
Method Details
-
setSchema
Set EC schema.- Parameters:
schema- schema.
-
getSchema
Get EC schema.- Returns:
- ECSchema.
-
getRequiredNumDataBlocks
public int getRequiredNumDataBlocks()Get required data blocks count in a BlockGroup.- Returns:
- count of required data blocks
-
getRequiredNumParityBlocks
public int getRequiredNumParityBlocks()Get required parity blocks count in a BlockGroup.- Returns:
- count of required parity blocks
-
makeBlockGroup
Calculating and organizing BlockGroup, to be called by ECManager- Parameters:
dataBlocks- Data blocks to compute parity blocks againstparityBlocks- To be computed parity blocks- Returns:
- ECBlockGroup.
-
anyRecoverable
Given a BlockGroup, tell if any of the missing blocks can be recovered, to be called by ECManager- Parameters:
blockGroup- a blockGroup that may contain erased blocks but not sure recoverable or not- Returns:
- true if any erased block recoverable, false otherwise
-