java.lang.Object
org.apache.hadoop.yarn.applications.distributedshell.PlacementSpec

public class PlacementSpec extends Object
Class encapsulating a SourceTag, number of container and a Placement Constraint.
  • Field Details

    • sourceTag

      public final String sourceTag
    • constraint

      public final org.apache.hadoop.yarn.api.resource.PlacementConstraint constraint
  • Constructor Details

    • PlacementSpec

      public PlacementSpec(String sourceTag, int numContainers, org.apache.hadoop.yarn.api.resource.PlacementConstraint constraint)
  • Method Details

    • getNumContainers

      public int getNumContainers()
      Get the number of container for this spec.
      Returns:
      container count
    • setNumContainers

      public void setNumContainers(int numContainers)
      Set number of containers for this spec.
      Parameters:
      numContainers - number of containers.
    • parse

      public static Map<String,PlacementSpec> parse(String specs) throws IllegalArgumentException
      Parser to convert a string representation of a placement spec to mapping from source tag to Placement Constraint.
      Parameters:
      specs - Placement spec.
      Returns:
      Mapping from source tag to placement constraint.
      Throws:
      IllegalArgumentException