Class PlacementConstraintsUtil
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.PlacementConstraintsUtil
This class contains various static methods used by the Placement Algorithms
to simplify constrained placement.
(see also
DefaultPlacementAlgorithm).-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanSatisfyConstraints(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.SchedulingRequest request, SchedulerNode schedulerNode, PlacementConstraintManager pcm, AllocationTagsManager atm) static booleancanSatisfyConstraints(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.SchedulingRequest request, SchedulerNode schedulerNode, PlacementConstraintManager pcm, AllocationTagsManager atm, Optional<DiagnosticsCollector> dcOpt) Returns true if the placement constraint for a given scheduling request is currently satisfied by the specific scheduler node.
-
Method Details
-
canSatisfyConstraints
public static boolean canSatisfyConstraints(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.SchedulingRequest request, SchedulerNode schedulerNode, PlacementConstraintManager pcm, AllocationTagsManager atm, Optional<DiagnosticsCollector> dcOpt) throws InvalidAllocationTagsQueryException Returns true if the placement constraint for a given scheduling request is currently satisfied by the specific scheduler node. This method first validates the constraint specified in the request; if not specified, then it validates application level constraint if exists; otherwise, it validates the global constraint if exists. This method only checks whether a scheduling request can be placed on a node with respect to the certain placement constraint. It gives no guarantee that asked allocations can be eventually allocated because it doesn't check resource, that needs to be further decided by a scheduler.- Parameters:
applicationId- application idrequest- scheduling requestschedulerNode- nodepcm- placement constraint manageratm- allocation tags managerdcOpt- optional diagnostics collector- Returns:
- true if the given node satisfies the constraint of the request
- Throws:
InvalidAllocationTagsQueryException- if given string is not in valid format.
-
canSatisfyConstraints
public static boolean canSatisfyConstraints(org.apache.hadoop.yarn.api.records.ApplicationId applicationId, org.apache.hadoop.yarn.api.records.SchedulingRequest request, SchedulerNode schedulerNode, PlacementConstraintManager pcm, AllocationTagsManager atm) throws InvalidAllocationTagsQueryException
-