Class CentralizedOpportunisticContainerAllocator

java.lang.Object
org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
org.apache.hadoop.yarn.server.resourcemanager.scheduler.distributed.CentralizedOpportunisticContainerAllocator

public class CentralizedOpportunisticContainerAllocator extends org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator

The CentralizedOpportunisticContainerAllocator allocates opportunistic containers by considering all the nodes present in the cluster, 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

    org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.Allocation, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.AllocationParams, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.ContainerIdGenerator, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.EnrichedResourceRequest, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator.PartitionedResourceRequests
  • Constructor Summary

    Constructors
    Constructor
    Description
    CentralizedOpportunisticContainerAllocator(org.apache.hadoop.yarn.server.security.BaseContainerTokenSecretManager tokenSecretManager)
    Create a new Centralized Opportunistic Container Allocator.
    CentralizedOpportunisticContainerAllocator(org.apache.hadoop.yarn.server.security.BaseContainerTokenSecretManager tokenSecretManager, int maxAllocationsPerAMHeartbeat, NodeQueueLoadMonitor nodeQueueLoadMonitor)
    Create a new Centralized Opportunistic Container Allocator.
  • Method Summary

    Modifier and Type
    Method
    Description
    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, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext opportContext, long rmIdentifier, String appSubmitter)
     

    Methods inherited from class org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator

    createContainer, getMaxAllocationsPerAMHeartbeat, getRemoteNodePartition, getRequestPartition, getTotalAllocations, matchAllocation, partitionAskList, setMaxAllocationsPerAMHeartbeat, updateBlacklist

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CentralizedOpportunisticContainerAllocator

      public CentralizedOpportunisticContainerAllocator(org.apache.hadoop.yarn.server.security.BaseContainerTokenSecretManager tokenSecretManager)
      Create a new Centralized Opportunistic Container Allocator.
      Parameters:
      tokenSecretManager - TokenSecretManager
    • CentralizedOpportunisticContainerAllocator

      public CentralizedOpportunisticContainerAllocator(org.apache.hadoop.yarn.server.security.BaseContainerTokenSecretManager tokenSecretManager, int maxAllocationsPerAMHeartbeat, NodeQueueLoadMonitor nodeQueueLoadMonitor)
      Create a new Centralized Opportunistic Container Allocator.
      Parameters:
      tokenSecretManager - TokenSecretManager
      maxAllocationsPerAMHeartbeat - max number of containers to be allocated in one AM heartbeat
      nodeQueueLoadMonitor - NodeQueueLoadMonitor.
  • 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, org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext opportContext, long rmIdentifier, String appSubmitter) throws org.apache.hadoop.yarn.exceptions.YarnException
      Specified by:
      allocateContainers in class org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException