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.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetValidSourceTag(Set<String> sourceTags) This method will return a single allocation tag.booleanvalidateConstraint(Set<String> sourceTags, org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint) Validate a placement constraint and the set of allocation tags that will enable it.protected booleanvalidateSourceTags(Set<String> sourceTags) Validates whether the allocation tags that will enable a constraint have the expected format.Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.PlacementConstraintManager
addConstraint, addGlobalConstraint, getConstraint, getConstraints, getGlobalConstraint, getMultilevelConstraint, getNumGlobalConstraints, getNumRegisteredApplications, registerApplication, removeGlobalConstraint, unregisterApplication
-
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:PlacementConstraintManagerValidate a placement constraint and the set of allocation tags that will enable it.- Specified by:
validateConstraintin interfacePlacementConstraintManager- Parameters:
sourceTags- the associated allocation tagsplacementConstraint- the constraint- Returns:
- true if constraint and tags are valid
-
validateSourceTags
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
This method will return a single allocation tag. It should be called after validating the tags by callingvalidateSourceTags(java.util.Set<java.lang.String>).- Parameters:
sourceTags- the source allocation tags- Returns:
- the single source tag
-