org.springframework.yarn.am.allocate
Class DefaultAllocateCountTracker

java.lang.Object
  extended by org.springframework.yarn.am.allocate.DefaultAllocateCountTracker

public class DefaultAllocateCountTracker
extends Object

Helper class tracking allocation counts. This separates counts for hosts into two states; in first state we have a counts of pending requests which are not yet sent into resource manager. in second state we have a counts which are sent into resource manager. These states allows us to loosely track needed counts sent during the allocation requests to minimise allocation garbage.

Author:
Janne Valkealahti

Nested Class Summary
static class DefaultAllocateCountTracker.AllocateCountInfo
           
 
Constructor Summary
DefaultAllocateCountTracker(Configuration configuration)
          Instantiates a new default allocate count tracker.
 
Method Summary
 void addContainers(ContainerAllocateData containerAllocateData)
          Adds new count of containers into 'host', 'rack' and 'any' pending requests.
 void addContainers(int count)
          Adds new count of containers into 'any' pending requests.
 DefaultAllocateCountTracker.AllocateCountInfo getAllocateCounts()
          Gets the allocate counts which should be used to create allocate requests.
 Container processAllocatedContainer(Container container)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAllocateCountTracker

public DefaultAllocateCountTracker(Configuration configuration)
Instantiates a new default allocate count tracker.

Parameters:
configuration - the hadoop configuration
Method Detail

addContainers

public void addContainers(int count)
Adds new count of containers into 'any' pending requests.

Parameters:
count - the count to add

addContainers

public void addContainers(ContainerAllocateData containerAllocateData)
Adds new count of containers into 'host', 'rack' and 'any' pending requests.

Parameters:
containerAllocateData - the container allocate data

getAllocateCounts

public DefaultAllocateCountTracker.AllocateCountInfo getAllocateCounts()
Gets the allocate counts which should be used to create allocate requests.

Returns:
the allocate counts

processAllocatedContainer

public Container processAllocatedContainer(Container container)

toString

public String toString()
Overrides:
toString in class Object