Class AllocateRequest

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

@Public @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:
  • Constructor Details

    • AllocateRequest

      public AllocateRequest()
  • Method Details

    • newInstance

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

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

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

      @Public @Stable public abstract int getResponseId()
      Get the response id used to track duplicate responses.
      Returns:
      response id
    • setResponseId

      @Public @Stable public abstract void setResponseId(int id)
      Set the response id used to track duplicate responses.
      Parameters:
      id - response id
    • getProgress

      @Public @Stable public abstract float getProgress()
      Get the current progress of application.
      Returns:
      current progress of application
    • setProgress

      @Public @Stable public abstract void setProgress(float progress)
      Set the current progress of application
      Parameters:
      progress - current progress of application
    • getAskList

      @Public @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:
    • setAskList

      @Public @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:
    • getReleaseList

      @Public @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

      @Public @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

      @Public @Stable public abstract ResourceBlacklistRequest getResourceBlacklistRequest()
      Get the ResourceBlacklistRequest being sent by the ApplicationMaster.
      Returns:
      the ResourceBlacklistRequest being sent by the ApplicationMaster
      See Also:
    • setResourceBlacklistRequest

      @Public @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:
    • getUpdateRequests

      @Public @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

      @Public @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

      @Public @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

      @Public @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

      @Public @Unstable public abstract String getTrackingUrl()
      Get the tracking url update for this heartbeat.
      Returns:
      tracking url to update this application with
    • setTrackingUrl

      @Public @Unstable public abstract void setTrackingUrl(String trackingUrl)
      Set the new tracking url for this application.
      Parameters:
      trackingUrl - the new tracking url
    • newBuilder

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