org.apache.hadoop.yarn.api.protocolrecords

## Class AllocateRequest

- java.lang.Object
- - org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest

-     @InterfaceAudience.Public
       @InterfaceStability.Stable
      public abstract class AllocateRequest
      extends Object

  The core request sent by the `ApplicationMaster` to the `ResourceManager` to obtain resources in the cluster.

  The request includes:

  - A response id to track duplicate responses.
  - Progress information.
  - A list of `ResourceRequest` to inform the `ResourceManager` about the application's resource requirements.
  - A list of unused `Container` which are being returned.
  - A list of `UpdateContainerRequest` to inform the `ResourceManager` about the change in requirements of running containers.
  See Also:
    `ApplicationMasterProtocol.allocate(AllocateRequest)`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AllocateRequest.AllocateRequestBuilder` Class to construct instances of `AllocateRequest` with specific options.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AllocateRequest()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract List<ResourceRequest>` | `getAskList()` Get the list of `ResourceRequest` to update the `ResourceManager` about the application's resource requirements.
    `abstract float` | `getProgress()` Get the current progress of application.
    `abstract List<ContainerId>` | `getReleaseList()` Get the list of `ContainerId` of containers being released by the `ApplicationMaster`.
    `abstract ResourceBlacklistRequest` | `getResourceBlacklistRequest()` Get the `ResourceBlacklistRequest` being sent by the `ApplicationMaster`.
    `abstract int` | `getResponseId()` Get the response id used to track duplicate responses.
    `List<SchedulingRequest>` | `getSchedulingRequests()` Get the list of Scheduling requests being sent by the `ApplicationMaster`.
    `abstract String` | `getTrackingUrl()` Get the tracking url update for this heartbeat.
    `abstract List<UpdateContainerRequest>` | `getUpdateRequests()` Get the list of container update requests being sent by the `ApplicationMaster`.
    `static AllocateRequest.AllocateRequestBuilder` | `newBuilder()`
    `static AllocateRequest` | `newInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, List<UpdateContainerRequest> updateRequests, ResourceBlacklistRequest resourceBlacklistRequest)`
    `static AllocateRequest` | `newInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, ResourceBlacklistRequest resourceBlacklistRequest)`
    `static AllocateRequest` | `newInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, ResourceBlacklistRequest resourceBlacklistRequest, String trackingUrl)`
    `abstract void` | `setAskList(List<ResourceRequest> resourceRequests)` Set list of `ResourceRequest` to update the `ResourceManager` about the application's resource requirements.
    `abstract void` | `setProgress(float progress)` Set the current progress of application
    `abstract void` | `setReleaseList(List<ContainerId> releaseContainers)` Set the list of `ContainerId` of containers being released by the `ApplicationMaster`
    `abstract void` | `setResourceBlacklistRequest(ResourceBlacklistRequest resourceBlacklistRequest)` Set the `ResourceBlacklistRequest` to inform the `ResourceManager` about the blacklist additions and removals per the `ApplicationMaster`.
    `abstract void` | `setResponseId(int id)` Set the response id used to track duplicate responses.
    `void` | `setSchedulingRequests(List<SchedulingRequest> schedulingRequests)` Set the list of Scheduling requests to inform the `ResourceManager` about the application's resource requirements (potentially including allocation tags and placement constraints).
    `abstract void` | `setTrackingUrl(String trackingUrl)` Set the new tracking url for this application.
    `abstract void` | `setUpdateRequests(List<UpdateContainerRequest> updateRequests)` Set the list of container update requests to inform the `ResourceManager` about the containers that need to be updated.

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

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

- - ### Constructor Detail

    - #### AllocateRequest

          public AllocateRequest()

  - ### Method Detail

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public static AllocateRequest newInstance(int responseID,
                                                                                                          float appProgress,
                                                                                                          List<ResourceRequest> resourceAsk,
                                                                                                          List<ContainerId> containersToBeReleased,
                                                                                                          ResourceBlacklistRequest resourceBlacklistRequest)

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public static AllocateRequest newInstance(int responseID,
                                                                                                            float appProgress,
                                                                                                            List<ResourceRequest> resourceAsk,
                                                                                                            List<ContainerId> containersToBeReleased,
                                                                                                            ResourceBlacklistRequest resourceBlacklistRequest,
                                                                                                            String trackingUrl)

    - #### newInstance

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public static AllocateRequest newInstance(int responseID,
                                                                                                            float appProgress,
                                                                                                            List<ResourceRequest> resourceAsk,
                                                                                                            List<ContainerId> containersToBeReleased,
                                                                                                            List<UpdateContainerRequest> updateRequests,
                                                                                                            ResourceBlacklistRequest resourceBlacklistRequest)

    - #### getResponseId

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract int getResponseId()

      Get the response id used to track duplicate responses.
      Returns:
        response id

    - #### setResponseId

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setResponseId(int id)

      Set the response id used to track duplicate responses.
      Parameters:
        `id` - response id

    - #### getProgress

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract float getProgress()

      Get the current progress of application.
      Returns:
        current progress of application

    - #### setProgress

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setProgress(float progress)

      Set the current progress of application
      Parameters:
        `progress` - current progress of application

    - #### getAskList

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract List<ResourceRequest> getAskList()

      Get the list of `ResourceRequest` to update the `ResourceManager` about the application's resource requirements.
      Returns:
        the list of `ResourceRequest`
      See Also:
        `ResourceRequest`

    - #### setAskList

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setAskList(List<ResourceRequest> resourceRequests)

      Set list of `ResourceRequest` to update the `ResourceManager` about the application's resource requirements.
      Parameters:
        `resourceRequests` - list of `ResourceRequest` to update the `ResourceManager` about the application's resource requirements
      See Also:
        `ResourceRequest`

    - #### getReleaseList

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract List<ContainerId> getReleaseList()

      Get the list of `ContainerId` of containers being released by the `ApplicationMaster`.
      Returns:
        list of `ContainerId` of containers being released by the `ApplicationMaster`

    - #### setReleaseList

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setReleaseList(List<ContainerId> releaseContainers)

      Set the list of `ContainerId` of containers being released by the `ApplicationMaster`
      Parameters:
        `releaseContainers` - list of `ContainerId` of containers being released by the `ApplicationMaster`

    - #### getResourceBlacklistRequest

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract ResourceBlacklistRequest getResourceBlacklistRequest()

      Get the `ResourceBlacklistRequest` being sent by the `ApplicationMaster`.
      Returns:
        the `ResourceBlacklistRequest` being sent by the `ApplicationMaster`
      See Also:
        `ResourceBlacklistRequest`

    - #### setResourceBlacklistRequest

          @InterfaceAudience.Public
           @InterfaceStability.Stable
          public abstract void setResourceBlacklistRequest(ResourceBlacklistRequest resourceBlacklistRequest)

      Set the `ResourceBlacklistRequest` to inform the `ResourceManager` about the blacklist additions and removals per the `ApplicationMaster`.
      Parameters:
        `resourceBlacklistRequest` - the `ResourceBlacklistRequest` to inform the `ResourceManager` about the blacklist additions and removals per the `ApplicationMaster`
      See Also:
        `ResourceBlacklistRequest`

    - #### getUpdateRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract List<UpdateContainerRequest> getUpdateRequests()

      Get the list of container update requests being sent by the `ApplicationMaster`.
      Returns:
        list of `UpdateContainerRequest` being sent by the `ApplicationMaster`.

    - #### setUpdateRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setUpdateRequests(List<UpdateContainerRequest> updateRequests)

      Set the list of container update requests to inform the `ResourceManager` about the containers that need to be updated.
      Parameters:
        `updateRequests` - list of `UpdateContainerRequest` for containers to be updated

    - #### getSchedulingRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public List<SchedulingRequest> getSchedulingRequests()

      Get the list of Scheduling requests being sent by the `ApplicationMaster`.
      Returns:
        list of `SchedulingRequest` being sent by the `ApplicationMaster`.

    - #### setSchedulingRequests

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public void setSchedulingRequests(List<SchedulingRequest> schedulingRequests)

      Set the list of Scheduling requests to inform the `ResourceManager` about the application's resource requirements (potentially including allocation tags and placement constraints).
      Parameters:
        `schedulingRequests` - list of `SchedulingRequest` to update the `ResourceManager` about the application's resource requirements.

    - #### getTrackingUrl

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract String getTrackingUrl()

      Get the tracking url update for this heartbeat.
      Returns:
        tracking url to update this application with

    - #### setTrackingUrl

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public abstract void setTrackingUrl(String trackingUrl)

      Set the new tracking url for this application.
      Parameters:
        `trackingUrl` - the new tracking url

    - #### newBuilder

          @InterfaceAudience.Public
           @InterfaceStability.Unstable
          public static AllocateRequest.AllocateRequestBuilder newBuilder()

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