Class AllocateRequest
java.lang.Object
org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest
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
ResourceRequestto inform theResourceManagerabout the application's resource requirements. -
A list of unused
Containerwhich are being returned. -
A list of
UpdateContainerRequestto inform theResourceManagerabout the change in requirements of running containers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classClass to construct instances ofAllocateRequestwith specific options. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract List<ResourceRequest>Get the list ofResourceRequestto update theResourceManagerabout the application's resource requirements.abstract floatGet the current progress of application.abstract List<ContainerId>Get the list ofContainerIdof containers being released by theApplicationMaster.abstract ResourceBlacklistRequestGet theResourceBlacklistRequestbeing sent by theApplicationMaster.abstract intGet the response id used to track duplicate responses.Get the list of Scheduling requests being sent by theApplicationMaster.abstract StringGet the tracking url update for this heartbeat.abstract List<UpdateContainerRequest>Get the list of container update requests being sent by theApplicationMaster.static AllocateRequestnewInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, List<UpdateContainerRequest> updateRequests, ResourceBlacklistRequest resourceBlacklistRequest) static AllocateRequestnewInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, ResourceBlacklistRequest resourceBlacklistRequest) static AllocateRequestnewInstance(int responseID, float appProgress, List<ResourceRequest> resourceAsk, List<ContainerId> containersToBeReleased, ResourceBlacklistRequest resourceBlacklistRequest, String trackingUrl) abstract voidsetAskList(List<ResourceRequest> resourceRequests) Set list ofResourceRequestto update theResourceManagerabout the application's resource requirements.abstract voidsetProgress(float progress) Set the current progress of applicationabstract voidsetReleaseList(List<ContainerId> releaseContainers) Set the list ofContainerIdof containers being released by theApplicationMasterabstract voidsetResourceBlacklistRequest(ResourceBlacklistRequest resourceBlacklistRequest) Set theResourceBlacklistRequestto inform theResourceManagerabout the blacklist additions and removals per theApplicationMaster.abstract voidsetResponseId(int id) Set the response id used to track duplicate responses.voidsetSchedulingRequests(List<SchedulingRequest> schedulingRequests) Set the list of Scheduling requests to inform theResourceManagerabout the application's resource requirements (potentially including allocation tags and placement constraints).abstract voidsetTrackingUrl(String trackingUrl) Set the new tracking url for this application.abstract voidsetUpdateRequests(List<UpdateContainerRequest> updateRequests) Set the list of container update requests to inform theResourceManagerabout the containers that need to be updated.
-
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
Get the list ofResourceRequestto update theResourceManagerabout the application's resource requirements.- Returns:
- the list of
ResourceRequest - See Also:
-
setAskList
Set list ofResourceRequestto update theResourceManagerabout the application's resource requirements.- Parameters:
resourceRequests- list ofResourceRequestto update theResourceManagerabout the application's resource requirements- See Also:
-
getReleaseList
Get the list ofContainerIdof containers being released by theApplicationMaster.- Returns:
- list of
ContainerIdof containers being released by theApplicationMaster
-
setReleaseList
Set the list ofContainerIdof containers being released by theApplicationMaster- Parameters:
releaseContainers- list ofContainerIdof containers being released by theApplicationMaster
-
getResourceBlacklistRequest
Get theResourceBlacklistRequestbeing sent by theApplicationMaster.- Returns:
- the
ResourceBlacklistRequestbeing sent by theApplicationMaster - See Also:
-
setResourceBlacklistRequest
@Public @Stable public abstract void setResourceBlacklistRequest(ResourceBlacklistRequest resourceBlacklistRequest) Set theResourceBlacklistRequestto inform theResourceManagerabout the blacklist additions and removals per theApplicationMaster.- Parameters:
resourceBlacklistRequest- theResourceBlacklistRequestto inform theResourceManagerabout the blacklist additions and removals per theApplicationMaster- See Also:
-
getUpdateRequests
Get the list of container update requests being sent by theApplicationMaster.- Returns:
- list of
UpdateContainerRequestbeing sent by theApplicationMaster.
-
setUpdateRequests
@Public @Unstable public abstract void setUpdateRequests(List<UpdateContainerRequest> updateRequests) Set the list of container update requests to inform theResourceManagerabout the containers that need to be updated.- Parameters:
updateRequests- list ofUpdateContainerRequestfor containers to be updated
-
getSchedulingRequests
Get the list of Scheduling requests being sent by theApplicationMaster.- Returns:
- list of
SchedulingRequestbeing sent by theApplicationMaster.
-
setSchedulingRequests
Set the list of Scheduling requests to inform theResourceManagerabout the application's resource requirements (potentially including allocation tags and placement constraints).- Parameters:
schedulingRequests- list ofSchedulingRequestto update theResourceManagerabout the application's resource requirements.
-
getTrackingUrl
Get the tracking url update for this heartbeat.- Returns:
- tracking url to update this application with
-
setTrackingUrl
Set the new tracking url for this application.- Parameters:
trackingUrl- the new tracking url
-
newBuilder
-