Class PlacementConstraintManagerService

java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.PlacementConstraintManagerService
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.service.Service, PlacementConstraintManager
Direct Known Subclasses:
MemoryPlacementConstraintManager

@Private @Unstable public abstract class PlacementConstraintManagerService extends org.apache.hadoop.service.AbstractService implements PlacementConstraintManager
The service that implements the PlacementConstraintManager interface.
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • PlacementConstraintManagerService

      public PlacementConstraintManagerService()
  • Method Details

    • validateConstraint

      public boolean validateConstraint(Set<String> sourceTags, org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint)
      Description copied from interface: PlacementConstraintManager
      Validate a placement constraint and the set of allocation tags that will enable it.
      Specified by:
      validateConstraint in interface PlacementConstraintManager
      Parameters:
      sourceTags - the associated allocation tags
      placementConstraint - the constraint
      Returns:
      true if constraint and tags are valid
    • validateSourceTags

      protected boolean validateSourceTags(Set<String> sourceTags)
      Validates whether the allocation tags that will enable a constraint have the expected format. At the moment we support a single allocation tag per constraint.
      Parameters:
      sourceTags - the source allocation tags
      Returns:
      true if the tags have the expected format
    • getValidSourceTag

      protected String getValidSourceTag(Set<String> sourceTags)
      This method will return a single allocation tag. It should be called after validating the tags by calling validateSourceTags(java.util.Set<java.lang.String>).
      Parameters:
      sourceTags - the source allocation tags
      Returns:
      the single source tag