Class PlacementSpec
java.lang.Object
org.apache.hadoop.yarn.applications.distributedshell.PlacementSpec
Class encapsulating a SourceTag, number of container and a Placement
Constraint.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.apache.hadoop.yarn.api.resource.PlacementConstraintfinal String -
Constructor Summary
ConstructorsConstructorDescriptionPlacementSpec(String sourceTag, int numContainers, org.apache.hadoop.yarn.api.resource.PlacementConstraint constraint) -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of container for this spec.static Map<String,PlacementSpec> Parser to convert a string representation of a placement spec to mapping from source tag to Placement Constraint.voidsetNumContainers(int numContainers) Set number of containers for this spec.
-
Field Details
-
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
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
-