BlockPlacementStatusWithNodeGroup (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.blockmanagement, class: BlockPlacementStatusWithNodeGroup

Package org.apache.hadoop.hdfs.server.blockmanagement

# Class BlockPlacementStatusWithNodeGroup

java.lang.Object
org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementStatusWithNodeGroup

All Implemented Interfaces:
  `BlockPlacementStatus`

@Private @Evolving public class BlockPlacementStatusWithNodeGroup extends Object implements BlockPlacementStatus
An implementation of @see BlockPlacementStatus for

See Also:
  - `BlockPlacementPolicyWithNodeGroup`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BlockPlacementStatusWithNodeGroup(BlockPlacementStatus parentBlockPlacementStatus, Set<String> currentNodeGroups, int requiredNodeGroups)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getAdditionalReplicasRequired()`
  Return the number of additional replicas needed to ensure the block placement policy is satisfied.
  `String`
  `getErrorDescription()`
  Get description info for log or printed in case replicas are failed to meet requirement of placement policy
  `boolean`
  `isPlacementPolicySatisfied()`
  Boolean value to identify if replicas of this block satisfy requirement of placement policy

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

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

- ## Constructor Details

  - ### BlockPlacementStatusWithNodeGroup

    public BlockPlacementStatusWithNodeGroup(BlockPlacementStatus parentBlockPlacementStatus, Set<String> currentNodeGroups, int requiredNodeGroups)
    Parameters:
      `parentBlockPlacementStatus` - the parent class' status
      `currentNodeGroups` - the current set of node groups of the replicas
      `requiredNodeGroups` - the number of required node groups

- ## Method Details

  - ### isPlacementPolicySatisfied

    public boolean isPlacementPolicySatisfied()
    Description copied from interface: `BlockPlacementStatus`
    Boolean value to identify if replicas of this block satisfy requirement of placement policy
    Specified by:
      `isPlacementPolicySatisfied` in interface `BlockPlacementStatus`
    Returns:
      if replicas satisfy placement policy's requirement

  - ### getErrorDescription

    public String getErrorDescription()
    Description copied from interface: `BlockPlacementStatus`
    Get description info for log or printed in case replicas are failed to meet requirement of placement policy
    Specified by:
      `getErrorDescription` in interface `BlockPlacementStatus`
    Returns:
      description in case replicas are failed to meet requirement of placement policy

  - ### getAdditionalReplicasRequired

    public int getAdditionalReplicasRequired()
    Description copied from interface: `BlockPlacementStatus`
    Return the number of additional replicas needed to ensure the block placement policy is satisfied.
    Specified by:
      `getAdditionalReplicasRequired` in interface `BlockPlacementStatus`
    Returns:
      The number of new replicas needed to satisify the placement policy or zero if no extra are needed