org.apache.hadoop.yarn.api.resource

## Class PlacementConstraint.TargetConstraint

- java.lang.Object
- - org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint
  - - org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint

- All Implemented Interfaces:
    PlacementConstraint.Visitable
  Enclosing class:
    PlacementConstraint

      public static class PlacementConstraint.TargetConstraint
      extends PlacementConstraint.AbstractConstraint

  Class that represents a target constraint. Such a constraint requires an allocation to be placed within a scope that satisfies some specified expressions on node attributes and allocation tags. It is a specialized version of the `PlacementConstraint.SingleConstraint`, where the minimum and the maximum cardinalities take specific values based on the `TargetOperator` used.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TargetConstraint(org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator op, String scope, Set<PlacementConstraint.TargetExpression> targetExpressions)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `accept(PlacementConstraint.Visitor<T> visitor)` Visitor pattern.
    `boolean` | `equals(Object o)`
    `org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator` | `getOp()` Get the target operator of the constraint.
    `String` | `getScope()` Get the scope of the constraint.
    `Set<PlacementConstraint.TargetExpression>` | `getTargetExpressions()` Get the set of target expressions.
    `int` | `hashCode()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.hadoop.yarn.api.resource.PlacementConstraint.AbstractConstraint

      `build`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TargetConstraint

          public TargetConstraint(org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator op,
                                  String scope,
                                  Set<PlacementConstraint.TargetExpression> targetExpressions)

  - ### Method Detail

    - #### getOp

          public org.apache.hadoop.yarn.api.resource.PlacementConstraint.TargetConstraint.TargetOperator getOp()

      Get the target operator of the constraint.
      Returns:
        the target operator

    - #### getScope

          public String getScope()

      Get the scope of the constraint.
      Returns:
        the scope of the constraint

    - #### getTargetExpressions

          public Set<PlacementConstraint.TargetExpression> getTargetExpressions()

      Get the set of target expressions.
      Returns:
        the set of target expressions

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `PlacementConstraint.AbstractConstraint`

    - #### accept

          public <T> T accept(PlacementConstraint.Visitor<T> visitor)

      Description copied from interface: `PlacementConstraint.Visitable`
      Visitor pattern.
      Type Parameters:
        `T` - defines the type that the visitor will use and the return type of the accept.
      Parameters:
        `visitor` - visitor to be used
      Returns:
        the result of visiting a given object.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.