org.apache.hadoop.yarn.api.protocolrecords
Interface AllocateResponse


@InterfaceAudience.Public
@InterfaceStability.Stable
public interface AllocateResponse

The response sent by the ResourceManager the ApplicationMaster during resource negotiation.

The response, includes:

See Also:
AMRMProtocol.allocate(AllocateRequest)

Method Summary
 List<Container> getAllocatedContainers()
          Get the list of newly allocated Container by the ResourceManager.
 Resource getAvailableResources()
          Get the available headroom for resources in the cluster for the application.
 List<ContainerStatus> getCompletedContainersStatuses()
          Get the list of completed containers' statuses.
 int getNumClusterNodes()
          Get the number of hosts available on the cluster.
 PreemptionMessage getPreemptionMessage()
          Get the description of containers owned by the AM, but requested back by the cluster.
 boolean getReboot()
          Should the ApplicationMaster reboot for being horribly out-of-sync with the ResourceManager as deigned by getResponseId()?
 int getResponseId()
          Get the last response id.
 List<NodeReport> getUpdatedNodes()
          Get the list of updated NodeReports.
 void setAllocatedContainers(List<Container> containers)
          Set the list of newly allocated Container by the ResourceManager.
 

Method Detail

getReboot

@InterfaceAudience.Public
@InterfaceStability.Stable
boolean getReboot()
Should the ApplicationMaster reboot for being horribly out-of-sync with the ResourceManager as deigned by getResponseId()?

Returns:
true if the ApplicationMaster should reboot, false otherwise

getResponseId

@InterfaceAudience.Public
@InterfaceStability.Stable
int getResponseId()
Get the last response id.

Returns:
last response id

getAllocatedContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
List<Container> getAllocatedContainers()
Get the list of newly allocated Container by the ResourceManager.

Returns:
list of newly allocated Container

setAllocatedContainers

@InterfaceAudience.Public
@InterfaceStability.Stable
void setAllocatedContainers(List<Container> containers)
Set the list of newly allocated Container by the ResourceManager.

Parameters:
containers - list of newly allocated Container

getAvailableResources

@InterfaceAudience.Public
@InterfaceStability.Stable
Resource getAvailableResources()
Get the available headroom for resources in the cluster for the application.

Returns:
limit of available headroom for resources in the cluster for the application

getCompletedContainersStatuses

@InterfaceAudience.Public
@InterfaceStability.Stable
List<ContainerStatus> getCompletedContainersStatuses()
Get the list of completed containers' statuses.

Returns:
the list of completed containers' statuses

getUpdatedNodes

@InterfaceAudience.Public
@InterfaceStability.Unstable
List<NodeReport> getUpdatedNodes()
Get the list of updated NodeReports. Updates could be changes in health, availability etc of the nodes.

Returns:
The delta of updated nodes since the last response

getNumClusterNodes

@InterfaceAudience.Public
@InterfaceStability.Stable
int getNumClusterNodes()
Get the number of hosts available on the cluster.

Returns:
the available host count.

getPreemptionMessage

@InterfaceAudience.Public
@InterfaceStability.Evolving
PreemptionMessage getPreemptionMessage()
Get the description of containers owned by the AM, but requested back by the cluster. Note that the RM may have an inconsistent view of the resources owned by the AM. These messages are advisory, and the AM may elect to ignore them. The message is a snapshot of the resources the RM wants back from the AM. While demand persists, the RM will repeat its request; applications should not interpret each message as a request for additional resources on top of previous messages. Resources requested consistently over some duration may be forcibly killed by the RM.

Returns:
A specification of the resources to reclaim from this AM.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.