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

Package org.apache.hadoop.io.erasurecode

# Class ECBlock

java.lang.Object
org.apache.hadoop.io.erasurecode.ECBlock

@Private public class ECBlock extends Object
A wrapper of block level data source/output that `ECChunk`s can be extracted from. For HDFS, it can be an HDFS block (250MB). Note it only cares about erasure coding specific logic thus avoids coupling with any HDFS block details. We can have something like HdfsBlock extend it.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ECBlock()`
  A default constructor. isParity and isErased are false by default.
  `ECBlock(boolean isParity, boolean isErased)`
  A constructor specifying isParity and isErased.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isErased()`
  `boolean`
  `isParity()`
  `void`
  `setErased(boolean isErased)`
  Set true if the block is missing.
  `void`
  `setParity(boolean isParity)`
  Set true if it's for a parity block.

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

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

- ## Constructor Details

  - ### ECBlock

    public ECBlock()
    A default constructor. isParity and isErased are false by default.

  - ### ECBlock

    public ECBlock(boolean isParity, boolean isErased)
    A constructor specifying isParity and isErased.
    Parameters:
      `isParity` - is a parity block
      `isErased` - is erased or not

- ## Method Details

  - ### setParity

    public void setParity(boolean isParity)
    Set true if it's for a parity block.
    Parameters:
      `isParity` - is parity or not

  - ### setErased

    public void setErased(boolean isErased)
    Set true if the block is missing.
    Parameters:
      `isErased` - is erased or not

  - ### isParity

    public boolean isParity()
    Returns:
      true if it's parity block, otherwise false

  - ### isErased

    public boolean isErased()
    Returns:
      true if it's erased due to erasure, otherwise false