Class AllocateResponse.AllocateResponseBuilder
java.lang.Object
org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse.AllocateResponseBuilder
- Enclosing class:
- AllocateResponse
@Private
@Unstable
public static final class AllocateResponse.AllocateResponseBuilder
extends Object
Class to construct instances of
AllocateResponse with specific
options.-
Method Summary
Modifier and TypeMethodDescriptionallocatedContainers(List<Container> allocatedContainers) Set theallocatedContainersof the response.Set theamCommandof the response.Set theamRmTokenof the response.applicationPriority(Priority applicationPriority) Set theapplicationPriorityof the response.availableResources(Resource availableResources) Set theavailableResourcesof the response.build()Return generatedAllocateResponseobject.collectorInfo(CollectorInfo collectorInfo) Set thecollectorInfoof the response.completedContainersStatuses(List<ContainerStatus> completedContainersStatuses) Set thecompletedContainersStatusesof the response.containersFromPreviousAttempt(List<Container> containersFromPreviousAttempt) Set thecontainersFromPreviousAttemptof the response.Set thenmTokensof the response.numClusterNodes(int numClusterNodes) Set thenumClusterNodesof the response.preemptionMessage(PreemptionMessage preemptionMessage) Set thepreemptionMessageof the response.responseId(int responseId) Set theresponseIdof the response.voidsetEnhancedHeadroom(EnhancedHeadroom enhancedHeadroom) updatedContainers(List<UpdatedContainer> updatedContainers) Set theupdatedContainersof the response.updatedNodes(List<NodeReport> updatedNodes) Set theupdatedNodesof the response.updateErrors(List<UpdateContainerError> updateErrors) Set theupdateErrorsof the response.
-
Method Details
-
amCommand
Set theamCommandof the response.- Parameters:
amCommand-amCommandof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
responseId
Set theresponseIdof the response.- Parameters:
responseId-responseIdof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
allocatedContainers
@Private @Unstable public AllocateResponse.AllocateResponseBuilder allocatedContainers(List<Container> allocatedContainers) Set theallocatedContainersof the response.- Parameters:
allocatedContainers-allocatedContainersof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
availableResources
@Private @Unstable public AllocateResponse.AllocateResponseBuilder availableResources(Resource availableResources) Set theavailableResourcesof the response.- Parameters:
availableResources-availableResourcesof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
completedContainersStatuses
@Private @Unstable public AllocateResponse.AllocateResponseBuilder completedContainersStatuses(List<ContainerStatus> completedContainersStatuses) Set thecompletedContainersStatusesof the response.- Parameters:
completedContainersStatuses-completedContainersStatusesof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
updatedNodes
@Private @Unstable public AllocateResponse.AllocateResponseBuilder updatedNodes(List<NodeReport> updatedNodes) Set theupdatedNodesof the response.- Parameters:
updatedNodes-updatedNodesof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
numClusterNodes
@Private @Unstable public AllocateResponse.AllocateResponseBuilder numClusterNodes(int numClusterNodes) Set thenumClusterNodesof the response.- Parameters:
numClusterNodes-numClusterNodesof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
preemptionMessage
@Private @Unstable public AllocateResponse.AllocateResponseBuilder preemptionMessage(PreemptionMessage preemptionMessage) Set thepreemptionMessageof the response.- Parameters:
preemptionMessage-preemptionMessageof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
nmTokens
Set thenmTokensof the response.- Parameters:
nmTokens-nmTokensof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
updatedContainers
@Private @Unstable public AllocateResponse.AllocateResponseBuilder updatedContainers(List<UpdatedContainer> updatedContainers) Set theupdatedContainersof the response.- Parameters:
updatedContainers-updatedContainersof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
amRmToken
Set theamRmTokenof the response.- Parameters:
amRmToken-amRmTokenof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
applicationPriority
@Private @Unstable public AllocateResponse.AllocateResponseBuilder applicationPriority(Priority applicationPriority) Set theapplicationPriorityof the response.- Parameters:
applicationPriority-applicationPriorityof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
collectorInfo
@Private @Unstable public AllocateResponse.AllocateResponseBuilder collectorInfo(CollectorInfo collectorInfo) Set thecollectorInfoof the response.- Parameters:
collectorInfo-collectorInfoof the response which contains collector address, RM id, version and collector token.- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
updateErrors
@Private @Unstable public AllocateResponse.AllocateResponseBuilder updateErrors(List<UpdateContainerError> updateErrors) Set theupdateErrorsof the response.- Parameters:
updateErrors-updateErrorsof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
containersFromPreviousAttempt
@Private @Unstable public AllocateResponse.AllocateResponseBuilder containersFromPreviousAttempt(List<Container> containersFromPreviousAttempt) Set thecontainersFromPreviousAttemptof the response.- Parameters:
containersFromPreviousAttempt-containersFromPreviousAttemptof the response- Returns:
AllocateResponse.AllocateResponseBuilder- See Also:
-
getEnhancedHeadroom
-
setEnhancedHeadroom
-
build
Return generatedAllocateResponseobject.- Returns:
AllocateResponse
-