@InterfaceAudience.Private @InterfaceStability.Unstable public class MemoryPlacementConstraintManager extends PlacementConstraintManagerService
PlacementConstraintManagerService.| Constructor and Description |
|---|
MemoryPlacementConstraintManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags,
org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint,
boolean replace)
Add a placement constraint for a given application and a given set of
(source) allocation tags.
|
void |
addGlobalConstraint(Set<String> sourceTags,
org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint,
boolean replace)
Add a placement constraint that will be used globally.
|
org.apache.hadoop.yarn.api.resource.PlacementConstraint |
getConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags)
Retrieve the placement constraint that is associated with a set of
allocation tags for a given application.
|
Map<Set<String>,org.apache.hadoop.yarn.api.resource.PlacementConstraint> |
getConstraints(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Retrieve all constraints for a given application, along with the allocation
tags that enable each constraint.
|
org.apache.hadoop.yarn.api.resource.PlacementConstraint |
getGlobalConstraint(Set<String> sourceTags)
Retrieve a global constraint that is associated with a given set of
allocation tags.
|
org.apache.hadoop.yarn.api.resource.PlacementConstraint |
getMultilevelConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags,
org.apache.hadoop.yarn.api.resource.PlacementConstraint schedulingRequestConstraint)
Consider all levels of constraints (scheduling request, app, cluster) and
return a merged constraint.
|
int |
getNumGlobalConstraints()
Returns the number of global constraints registered in the Placement
Constraint Manager.
|
int |
getNumRegisteredApplications()
Returns the number of currently registered applications in the Placement
Constraint Manager.
|
void |
registerApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Map<Set<String>,org.apache.hadoop.yarn.api.resource.PlacementConstraint> constraintMap)
Register all placement constraints of an application.
|
void |
removeGlobalConstraint(Set<String> sourceTags)
Remove a global constraint that is associated with the given allocation
tags.
|
protected void |
serviceInit(org.apache.hadoop.conf.Configuration conf) |
void |
unregisterApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
Remove the constraints that correspond to a given application.
|
getValidSourceTag, validateConstraint, validateSourceTagsclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceStart, serviceStop, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopprotected void serviceInit(org.apache.hadoop.conf.Configuration conf)
throws Exception
serviceInit in class org.apache.hadoop.service.AbstractServiceExceptionpublic void registerApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Map<Set<String>,org.apache.hadoop.yarn.api.resource.PlacementConstraint> constraintMap)
PlacementConstraintManagerappId - the application IDconstraintMap - the map of allocation tags to constraints for this
applicationpublic void addConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags,
org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint,
boolean replace)
PlacementConstraintManagerappId - the application IDsourceTags - the set of allocation tags that will enable this
constraintplacementConstraint - the constraintreplace - if true, an existing constraint for these tags will be
replaced by the given onepublic void addGlobalConstraint(Set<String> sourceTags, org.apache.hadoop.yarn.api.resource.PlacementConstraint placementConstraint, boolean replace)
PlacementConstraintManagersourceTags - the allocation tags that will enable this constraintplacementConstraint - the constraintreplace - if true, an existing constraint for these tags will be
replaced by the given onepublic Map<Set<String>,org.apache.hadoop.yarn.api.resource.PlacementConstraint> getConstraints(org.apache.hadoop.yarn.api.records.ApplicationId appId)
PlacementConstraintManagerappId - the application IDpublic org.apache.hadoop.yarn.api.resource.PlacementConstraint getConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags)
PlacementConstraintManagerappId - the application IDsourceTags - the allocation tags that enable this constraintpublic org.apache.hadoop.yarn.api.resource.PlacementConstraint getGlobalConstraint(Set<String> sourceTags)
PlacementConstraintManagersourceTags - the allocation tags that enable this constraintpublic org.apache.hadoop.yarn.api.resource.PlacementConstraint getMultilevelConstraint(org.apache.hadoop.yarn.api.records.ApplicationId appId,
Set<String> sourceTags,
org.apache.hadoop.yarn.api.resource.PlacementConstraint schedulingRequestConstraint)
PlacementConstraintManagerappId - application IDsourceTags - a set of source allocation tagsschedulingRequestConstraint - placement constraint at scheduling
request levelpublic void unregisterApplication(org.apache.hadoop.yarn.api.records.ApplicationId appId)
PlacementConstraintManagerappId - the application that will be removed.public void removeGlobalConstraint(Set<String> sourceTags)
PlacementConstraintManagersourceTags - the allocation tagspublic int getNumRegisteredApplications()
PlacementConstraintManagerpublic int getNumGlobalConstraints()
PlacementConstraintManagerCopyright © 2008–2023 Apache Software Foundation. All rights reserved.