BlockGrouper (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io.erasurecode.grouper, class: BlockGrouper

Package org.apache.hadoop.io.erasurecode.grouper

# 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 Summary

  Constructors
  Constructor
  Description
  `BlockGrouper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `anyRecoverable(ECBlockGroup blockGroup)`
  Given a BlockGroup, tell if any of the missing blocks can be recovered, to be called by ECManager
  `int`
  `getRequiredNumDataBlocks()`
  Get required data blocks count in a BlockGroup.
  `int`
  `getRequiredNumParityBlocks()`
  Get required parity blocks count in a BlockGroup.
  `protected ECSchema`
  `getSchema()`
  Get EC schema.
  `ECBlockGroup`
  `makeBlockGroup(ECBlock[] dataBlocks, ECBlock[] parityBlocks)`
  Calculating and organizing BlockGroup, to be called by ECManager
  `void`
  `setSchema(ECSchema schema)`
  Set EC schema.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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