Class BatchedRequests
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.processor.BatchedRequests
- All Implemented Interfaces:
Iterable<org.apache.hadoop.yarn.api.records.SchedulingRequest>,ConstraintPlacementAlgorithmInput
public class BatchedRequests
extends Object
implements ConstraintPlacementAlgorithmInput, Iterable<org.apache.hadoop.yarn.api.records.SchedulingRequest>
A grouping of Scheduling Requests which are sent to the PlacementAlgorithm
to place as a batch. The placement algorithm tends to give more optimal
placements if more requests are batched together.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBatchedRequests(BatchedRequests.IteratorType type, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, Collection<org.apache.hadoop.yarn.api.records.SchedulingRequest> requests, int attempt) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToBatch(org.apache.hadoop.yarn.api.records.SchedulingRequest req) Add a Scheduling request to the batch.voidaddToBlacklist(Set<String> tags, SchedulerNode node) org.apache.hadoop.yarn.api.records.ApplicationIdGet Application Id.Set<org.apache.hadoop.yarn.api.records.NodeId>getBlacklist(String tag) Get any blacklisted nodes associated with tag.Get Iterator type.intGet placement attempt.Collection<org.apache.hadoop.yarn.api.records.SchedulingRequest>Get Collection of SchedulingRequests in this batch.Iterator<org.apache.hadoop.yarn.api.records.SchedulingRequest>iterator()Exposes SchedulingRequest Iterator interface which can be used to traverse requests using different heuristics i.e.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BatchedRequests
public BatchedRequests(BatchedRequests.IteratorType type, org.apache.hadoop.yarn.api.records.ApplicationId applicationId, Collection<org.apache.hadoop.yarn.api.records.SchedulingRequest> requests, int attempt)
-
-
Method Details
-
iterator
Exposes SchedulingRequest Iterator interface which can be used to traverse requests using different heuristics i.e. Tag Popularity -
getApplicationId
public org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()Get Application Id.- Returns:
- Application Id.
-
getSchedulingRequests
Get Collection of SchedulingRequests in this batch.- Specified by:
getSchedulingRequestsin interfaceConstraintPlacementAlgorithmInput- Returns:
- Collection of Scheduling Requests.
-
addToBatch
public void addToBatch(org.apache.hadoop.yarn.api.records.SchedulingRequest req) Add a Scheduling request to the batch.- Parameters:
req- Scheduling Request.
-
addToBlacklist
-
getPlacementAttempt
public int getPlacementAttempt()Get placement attempt.- Returns:
- PlacementAlgorithmOutput placement Attempt.
-
getBlacklist
Get any blacklisted nodes associated with tag.- Parameters:
tag- Tag.- Returns:
- Set of blacklisted Nodes.
-
getIteratorType
Get Iterator type.- Returns:
- Iterator type.
-