Class DistributedOpportunisticContainerAllocator

java.lang.Object
org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerAllocator
org.apache.hadoop.yarn.server.scheduler.DistributedOpportunisticContainerAllocator

public class DistributedOpportunisticContainerAllocator extends OpportunisticContainerAllocator

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.

  • 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 - TokenSecretManager
      maxAllocationsPerAMHeartbeat - 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: OpportunisticContainerAllocator
      Allocate OPPORTUNISTIC containers.
      Specified by:
      allocateContainers in class OpportunisticContainerAllocator
      Parameters:
      blackList - Resource BlackList Request
      oppResourceReqs - Opportunistic Resource Requests
      applicationAttemptId - ApplicationAttemptId
      opportContext - App specific OpportunisticContainerContext
      rmIdentifier - RM Identifier
      appSubmitter - App Submitter
      Returns:
      List of Containers.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException - YarnException