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 PlacementConstraint.TargetConstraint.TargetOperator used.
  • Constructor Details

  • Method Details

    • 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.