Class DistributedOpportunisticContainerAllocator
java.lang.Object
org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
org.apache.hadoop.yarn.server.scheduler.DistributedOpportunisticContainerAllocator
The DistributedOpportunisticContainerAllocator allocates containers on a given list of nodes, after modifying the container sizes to respect the limits set by the ResourceManager. It tries to distribute the containers as evenly as possible.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
OpportunisticContainerAllocator.Allocation, OpportunisticContainerAllocator.AllocationParams, OpportunisticContainerAllocator.ContainerIdGenerator, OpportunisticContainerAllocator.EnrichedResourceRequest, OpportunisticContainerAllocator.PartitionedResourceRequests -
Constructor Summary
ConstructorsConstructorDescriptionDistributedOpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager) Create a new Opportunistic Container Allocator.DistributedOpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager, int maxAllocationsPerAMHeartbeat) Create a new Opportunistic Container Allocator. -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.hadoop.yarn.api.records.Container>allocateContainers(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList, List<org.apache.hadoop.yarn.api.records.ResourceRequest> oppResourceReqs, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, OpportunisticContainerContext opportContext, long rmIdentifier, String appSubmitter) Allocate OPPORTUNISTIC containers.Methods inherited from class org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
createContainer, getMaxAllocationsPerAMHeartbeat, getRemoteNodePartition, getRequestPartition, getTotalAllocations, matchAllocation, partitionAskList, setMaxAllocationsPerAMHeartbeat, updateBlacklist
-
Constructor Details
-
DistributedOpportunisticContainerAllocator
public DistributedOpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager) Create a new Opportunistic Container Allocator.- Parameters:
tokenSecretManager- TokenSecretManager
-
DistributedOpportunisticContainerAllocator
public DistributedOpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager, int maxAllocationsPerAMHeartbeat) Create a new Opportunistic Container Allocator.- Parameters:
tokenSecretManager- TokenSecretManagermaxAllocationsPerAMHeartbeat- max number of containers to be allocated in one AM heartbeat
-
-
Method Details
-
allocateContainers
public List<org.apache.hadoop.yarn.api.records.Container> allocateContainers(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList, List<org.apache.hadoop.yarn.api.records.ResourceRequest> oppResourceReqs, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, OpportunisticContainerContext opportContext, long rmIdentifier, String appSubmitter) throws org.apache.hadoop.yarn.exceptions.YarnException Description copied from class:OpportunisticContainerAllocatorAllocate OPPORTUNISTIC containers.- Specified by:
allocateContainersin classOpportunisticContainerAllocator- Parameters:
blackList- Resource BlackList RequestoppResourceReqs- Opportunistic Resource RequestsapplicationAttemptId- ApplicationAttemptIdopportContext- App specific OpportunisticContainerContextrmIdentifier- RM IdentifierappSubmitter- App Submitter- Returns:
- List of Containers.
- Throws:
org.apache.hadoop.yarn.exceptions.YarnException- YarnException
-