Spring for Apache Hadoop

org.springframework.yarn.am.allocate
Class DefaultAllocateCountTracker

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

public class DefaultAllocateCountTracker
extends java.lang.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

Constructor Summary
DefaultAllocateCountTracker()
           
 
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.
 java.util.Map<java.lang.String,java.lang.Integer> getAllocateCounts()
          Gets the allocate counts which should be used to create allocate requests.
 org.apache.hadoop.yarn.api.records.Container processAllocatedContainer(org.apache.hadoop.yarn.api.records.Container container)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAllocateCountTracker

public DefaultAllocateCountTracker()
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 java.util.Map<java.lang.String,java.lang.Integer> getAllocateCounts()
Gets the allocate counts which should be used to create allocate requests.

Returns:
the allocate counts

processAllocatedContainer

public org.apache.hadoop.yarn.api.records.Container processAllocatedContainer(org.apache.hadoop.yarn.api.records.Container container)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Spring for Apache Hadoop