DistributedOpportunisticContainerAllocatorpublic abstract class OpportunisticContainerAllocator
extends java.lang.Object
Base abstract class for Opportunistic container allocations, that provides common functions required for Opportunistic container allocation.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
OpportunisticContainerAllocator.Allocation |
This class encapsulates container and resourceName for an allocation.
|
static class |
OpportunisticContainerAllocator.AllocationParams |
This class encapsulates application specific parameters used to build a
Container.
|
static class |
OpportunisticContainerAllocator.ContainerIdGenerator |
A Container Id Generator.
|
static class |
OpportunisticContainerAllocator.EnrichedResourceRequest |
This class encapsulates Resource Request and provides requests per
node and rack.
|
static class |
OpportunisticContainerAllocator.PartitionedResourceRequests |
Class that includes two lists of
ResourceRequests: one for
GUARANTEED and one for OPPORTUNISTIC ResourceRequests. |
| Constructor | Description |
|---|---|
OpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager) |
Create a new Opportunistic Container Allocator.
|
OpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager,
int maxAllocationsPerAMHeartbeat) |
Create a new Opportunistic Container Allocator.
|
| Modifier and Type | Method | Description |
|---|---|---|
abstract java.util.List<org.apache.hadoop.yarn.api.records.Container> |
allocateContainers(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList,
java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> oppResourceReqs,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
OpportunisticContainerContext opportContext,
long rmIdentifier,
java.lang.String appSubmitter) |
Allocate OPPORTUNISTIC containers.
|
protected org.apache.hadoop.yarn.api.records.Container |
createContainer(long rmIdentifier,
OpportunisticContainerAllocator.AllocationParams appParams,
OpportunisticContainerAllocator.ContainerIdGenerator idCounter,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId id,
java.lang.String userName,
java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>> allocations,
java.lang.String location,
org.apache.hadoop.yarn.api.records.ResourceRequest anyAsk,
RemoteNode rNode) |
|
int |
getMaxAllocationsPerAMHeartbeat() |
Get the Max Allocations per AM heartbeat.
|
protected java.lang.String |
getRemoteNodePartition(RemoteNode node) |
|
protected java.lang.String |
getRequestPartition(OpportunisticContainerAllocator.EnrichedResourceRequest enrichedRR) |
|
protected int |
getTotalAllocations(java.util.List<java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>>> allocations) |
|
protected void |
matchAllocation(java.util.List<java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>>> allocations,
java.util.List<org.apache.hadoop.yarn.api.records.Container> allocatedContainers,
OpportunisticContainerContext oppContext) |
|
OpportunisticContainerAllocator.PartitionedResourceRequests |
partitionAskList(java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> askList) |
Partitions a list of ResourceRequest to two separate lists, one for
GUARANTEED and one for OPPORTUNISTIC ResourceRequests.
|
void |
setMaxAllocationsPerAMHeartbeat(int maxAllocationsPerAMHeartbeat) |
|
protected void |
updateBlacklist(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList,
OpportunisticContainerContext oppContext) |
public OpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager)
tokenSecretManager - TokenSecretManagerpublic OpportunisticContainerAllocator(BaseContainerTokenSecretManager tokenSecretManager, int maxAllocationsPerAMHeartbeat)
tokenSecretManager - TokenSecretManagermaxAllocationsPerAMHeartbeat - max number of containers to be
allocated in one AM heartbeatpublic void setMaxAllocationsPerAMHeartbeat(int maxAllocationsPerAMHeartbeat)
public int getMaxAllocationsPerAMHeartbeat()
public abstract java.util.List<org.apache.hadoop.yarn.api.records.Container> allocateContainers(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList,
java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> oppResourceReqs,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
OpportunisticContainerContext opportContext,
long rmIdentifier,
java.lang.String appSubmitter)
throws org.apache.hadoop.yarn.exceptions.YarnException
blackList - Resource BlackList RequestoppResourceReqs - Opportunistic Resource RequestsapplicationAttemptId - ApplicationAttemptIdopportContext - App specific OpportunisticContainerContextrmIdentifier - RM IdentifierappSubmitter - App Submitterorg.apache.hadoop.yarn.exceptions.YarnException - YarnExceptionprotected void updateBlacklist(org.apache.hadoop.yarn.api.records.ResourceBlacklistRequest blackList,
OpportunisticContainerContext oppContext)
protected void matchAllocation(java.util.List<java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>>> allocations, java.util.List<org.apache.hadoop.yarn.api.records.Container> allocatedContainers, OpportunisticContainerContext oppContext)
protected int getTotalAllocations(java.util.List<java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>>> allocations)
protected org.apache.hadoop.yarn.api.records.Container createContainer(long rmIdentifier,
OpportunisticContainerAllocator.AllocationParams appParams,
OpportunisticContainerAllocator.ContainerIdGenerator idCounter,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId id,
java.lang.String userName,
java.util.Map<org.apache.hadoop.yarn.api.records.Resource,java.util.List<OpportunisticContainerAllocator.Allocation>> allocations,
java.lang.String location,
org.apache.hadoop.yarn.api.records.ResourceRequest anyAsk,
RemoteNode rNode)
throws org.apache.hadoop.yarn.exceptions.YarnException
org.apache.hadoop.yarn.exceptions.YarnExceptionpublic OpportunisticContainerAllocator.PartitionedResourceRequests partitionAskList(java.util.List<org.apache.hadoop.yarn.api.records.ResourceRequest> askList)
askList - the list of ResourceRequests to be partitionedprotected java.lang.String getRequestPartition(OpportunisticContainerAllocator.EnrichedResourceRequest enrichedRR)
protected java.lang.String getRemoteNodePartition(RemoteNode node)
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.