org.apache.hadoop.mapreduce.v2.app.rm

## Class RMContainerAllocator

- java.lang.Object
- - org.apache.hadoop.service.AbstractService
  - - org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator
    - - org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor
      - - org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator

- All Implemented Interfaces:
    Closeable, AutoCloseable, ContainerAllocator, RMHeartbeatHandler, org.apache.hadoop.service.Service, org.apache.hadoop.yarn.event.EventHandler<ContainerAllocatorEvent>

      public class RMContainerAllocator
      extends RMContainerRequestor
      implements ContainerAllocator

  Allocates the container from the ResourceManager scheduler.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator

      `RMCommunicator.AllocatorRunnable`

    - ### Nested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.v2.app.rm.ContainerAllocator

      `ContainerAllocator.EventType`

    - ### Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service

      `org.apache.hadoop.service.Service.STATE`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static float` | `DEFAULT_COMPLETED_MAPS_PERCENT_FOR_REDUCE_SLOWSTART`
    `protected BlockingQueue<ContainerAllocatorEvent>` | `eventQueue`
    `static String` | `RAMPDOWN_DIAGNOSTIC`

    - ### Fields inherited from class org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor

      `lastResponseID, pendingRelease`

    - ### Fields inherited from class org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator

      `allocatorThread, applicationACLs, applicationId, eventHandler, isSignalled, scheduler`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RMContainerAllocator(ClientService clientService, AppContext context, AMPreemptionPolicy preemptionPolicy)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.AssignedRequests` | `createAssignedRequests()`
    `TaskAttemptEvent` | `createContainerFinishedEvent(org.apache.hadoop.yarn.api.records.ContainerStatus cont, org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptId)`
    `boolean` | `getIsReduceStarted()`
    `org.apache.hadoop.yarn.api.records.Resource` | `getResourceLimit()`
    `void` | `handle(ContainerAllocatorEvent event)`
    `protected void` | `handleEvent(ContainerAllocatorEvent event)`
    `protected void` | `heartbeat()`
    `void` | `rampDownReduces(int rampDown)`
    `void` | `rampUpReduces(int rampUp)`
    `void` | `scheduleAllReduces()`
    `void` | `scheduleReduces(int totalMaps, int completedMaps, int scheduledMaps, int scheduledReduces, int assignedMaps, int assignedReduces, org.apache.hadoop.yarn.api.records.Resource mapResourceReqt, org.apache.hadoop.yarn.api.records.Resource reduceResourceReqt, int numPendingReduces, float maxReduceRampupLimit, float reduceSlowStart)`
    `protected void` | `serviceInit(org.apache.hadoop.conf.Configuration conf)`
    `protected void` | `serviceStart()`
    `protected void` | `serviceStop()`
    `void` | `setIsReduceStarted(boolean reduceStarted)`

    - ### Methods inherited from class org.apache.hadoop.mapreduce.v2.app.rm.RMContainerRequestor

      `addContainerReq, addOpportunisticResourceRequest, addOutstandingRequestOnResync, computeIgnoreBlacklisting, containerFailedOnHost, decContainerReq, getAvailableResources, getBlacklistedNodes, getFilteredContainerRequest, isNodeBlacklisted, makeRemoteRequest, release, setRequestLimit`

    - ### Methods inherited from class org.apache.hadoop.mapreduce.v2.app.rm.RMCommunicator

      `createSchedulerProxy, doUnregistration, getApplicationProgress, getContext, getJob, getLastHeartbeatTime, getMaxContainerCapability, getSchedulerResourceTypes, isApplicationMasterRegistered, register, runOnNextHeartbeat, setShouldUnregister, setSignalled, startAllocatorThread, unregister`

    - ### Methods inherited from class org.apache.hadoop.service.AbstractService

      `close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_COMPLETED_MAPS_PERCENT_FOR_REDUCE_SLOWSTART

          public static final float DEFAULT_COMPLETED_MAPS_PERCENT_FOR_REDUCE_SLOWSTART

      See Also:
        Constant Field Values

    - #### RAMPDOWN_DIAGNOSTIC

          public static final String RAMPDOWN_DIAGNOSTIC

      See Also:
        Constant Field Values

    - #### eventQueue

          protected BlockingQueue<ContainerAllocatorEvent> eventQueue

  - ### Constructor Detail

    - #### RMContainerAllocator

          public RMContainerAllocator(ClientService clientService,
                                      AppContext context,
                                      AMPreemptionPolicy preemptionPolicy)

  - ### Method Detail

    - #### createAssignedRequests

          protected org.apache.hadoop.mapreduce.v2.app.rm.RMContainerAllocator.AssignedRequests createAssignedRequests()

    - #### serviceInit

          protected void serviceInit(org.apache.hadoop.conf.Configuration conf)
                              throws Exception

      Overrides:
        `serviceInit` in class `RMContainerRequestor`
      Throws:
        `Exception`

    - #### serviceStart

          protected void serviceStart()
                               throws Exception

      Overrides:
        `serviceStart` in class `RMCommunicator`
      Throws:
        `Exception`

    - #### heartbeat

          protected void heartbeat()
                            throws Exception

      Specified by:
        `heartbeat` in class `RMCommunicator`
      Throws:
        `Exception`

    - #### serviceStop

          protected void serviceStop()
                              throws Exception

      Overrides:
        `serviceStop` in class `RMCommunicator`
      Throws:
        `Exception`

    - #### getIsReduceStarted

          public boolean getIsReduceStarted()

    - #### setIsReduceStarted

          public void setIsReduceStarted(boolean reduceStarted)

    - #### handle

          public void handle(ContainerAllocatorEvent event)

      Specified by:
        `handle` in interface `org.apache.hadoop.yarn.event.EventHandler<ContainerAllocatorEvent>`

    - #### handleEvent

          protected void handleEvent(ContainerAllocatorEvent event)

    - #### scheduleReduces

          @InterfaceAudience.Private
          public void scheduleReduces(int totalMaps,
                                                                 int completedMaps,
                                                                 int scheduledMaps,
                                                                 int scheduledReduces,
                                                                 int assignedMaps,
                                                                 int assignedReduces,
                                                                 org.apache.hadoop.yarn.api.records.Resource mapResourceReqt,
                                                                 org.apache.hadoop.yarn.api.records.Resource reduceResourceReqt,
                                                                 int numPendingReduces,
                                                                 float maxReduceRampupLimit,
                                                                 float reduceSlowStart)

    - #### scheduleAllReduces

          @InterfaceAudience.Private
          public void scheduleAllReduces()

    - #### rampUpReduces

          @InterfaceAudience.Private
          public void rampUpReduces(int rampUp)

    - #### rampDownReduces

          @InterfaceAudience.Private
          public void rampDownReduces(int rampDown)

    - #### createContainerFinishedEvent

          public TaskAttemptEvent createContainerFinishedEvent(org.apache.hadoop.yarn.api.records.ContainerStatus cont,
                                                               org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId attemptId)

    - #### getResourceLimit

          @InterfaceAudience.Private
          public org.apache.hadoop.yarn.api.records.Resource getResourceLimit()

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.