Class BlockGrouper

java.lang.Object
org.apache.hadoop.io.erasurecode.grouper.BlockGrouper

@Private public class BlockGrouper extends Object
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 Details

    • BlockGrouper

      public BlockGrouper()
  • Method Details

    • setSchema

      public void setSchema(ECSchema schema)
      Set EC schema.
      Parameters:
      schema - schema.
    • getSchema

      protected ECSchema 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

      public ECBlockGroup makeBlockGroup(ECBlock[] dataBlocks, ECBlock[] parityBlocks)
      Calculating and organizing BlockGroup, to be called by ECManager
      Parameters:
      dataBlocks - Data blocks to compute parity blocks against
      parityBlocks - To be computed parity blocks
      Returns:
      ECBlockGroup.
    • anyRecoverable

      public boolean anyRecoverable(ECBlockGroup blockGroup)
      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