|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.yarn.support.LifecycleObjectSupport org.springframework.yarn.am.allocate.AbstractAllocator org.springframework.yarn.am.allocate.AbstractPollingAllocator org.springframework.yarn.am.allocate.DefaultContainerAllocator
public class DefaultContainerAllocator
Default allocator which polls resource manager, requests new containers and acts as a heart beat sender at the same time.
Constructor Summary | |
---|---|
DefaultContainerAllocator()
|
Method Summary | |
---|---|
void |
addListener(ContainerAllocatorListener listener)
Adds the ContainerAllocatorListener . |
void |
allocateContainers(ContainerAllocateData containerAllocateData)
Allocate new containers. |
void |
allocateContainers(int count)
Allocate new containers. |
protected org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse |
doContainerRequest()
Subclasses needs to implements this method to do container requests against resource manager. |
java.lang.String[] |
getHosts()
Gets the hosts. |
int |
getMemory()
Gets the memory for container request. |
int |
getPriority()
Gets the priority for container request. |
java.lang.String[] |
getRacks()
Gets the racks. |
int |
getVirtualcores()
Gets the virtualcores for container request. |
protected void |
handleAllocatedContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
Subclasses needs to implement this method to handle newly allocated containers. |
protected void |
handleCompletedContainers(java.util.List<org.apache.hadoop.yarn.api.records.ContainerStatus> containerStatuses)
Subclasses needs to implement this method to handle newly released containers. |
protected java.util.List<org.apache.hadoop.yarn.api.records.Container> |
preProcessAllocatedContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
Pre-process allocated containers. |
void |
releaseContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Release container. |
void |
releaseContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
Release containers. |
void |
setHosts(java.lang.String[] hosts)
Sets the hosts. |
void |
setMemory(int memory)
Sets the memory for container request defining memory of the resource. |
void |
setPriority(int priority)
Sets the priority for container request. |
void |
setProgress(float progress)
Sets the current progress of application. |
void |
setRacks(java.lang.String[] racks)
Sets the racks. |
void |
setVirtualcores(int virtualcores)
Sets the virtualcores for container request defining number of virtual cpu cores of the resource. |
Methods inherited from class org.springframework.yarn.am.allocate.AbstractPollingAllocator |
---|
doStart, doStop, onInit, populateNmTokenCache, setTrigger |
Methods inherited from class org.springframework.yarn.am.allocate.AbstractAllocator |
---|
getApplicationAttemptId, getConfiguration, getEnvironment, getRmTemplate, setApplicationAttemptId, setConfiguration, setEnvironment, setRmTemplate |
Methods inherited from class org.springframework.yarn.support.LifecycleObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultContainerAllocator()
Method Detail |
---|
public void allocateContainers(int count)
ContainerAllocator
allocateContainers
in interface ContainerAllocator
count
- the new container count to allocatepublic void addListener(ContainerAllocatorListener listener)
ContainerAllocator
ContainerAllocatorListener
.
addListener
in interface ContainerAllocator
listener
- the ContainerAllocatorListener
public void allocateContainers(ContainerAllocateData containerAllocateData)
ContainerAllocator
allocateContainers
in interface ContainerAllocator
containerAllocateData
- the ContainerAllocateData
public void releaseContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
ContainerAllocator
releaseContainers
in interface ContainerAllocator
containers
- the containerspublic void releaseContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
ContainerAllocator
releaseContainer
in interface ContainerAllocator
containerId
- the container idprotected org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse doContainerRequest()
AbstractPollingAllocator
AbstractPollingAllocator.handleAllocatedContainers(List)
and
AbstractPollingAllocator.handleCompletedContainers(List)
.
doContainerRequest
in class AbstractPollingAllocator
AllocateResponse
from a resource managerprotected java.util.List<org.apache.hadoop.yarn.api.records.Container> preProcessAllocatedContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
AbstractPollingAllocator
preProcessAllocatedContainers
in class AbstractPollingAllocator
containers
- the containers
protected void handleAllocatedContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
AbstractPollingAllocator
handleAllocatedContainers
in class AbstractPollingAllocator
containers
- list of newly allocate containersprotected void handleCompletedContainers(java.util.List<org.apache.hadoop.yarn.api.records.ContainerStatus> containerStatuses)
AbstractPollingAllocator
handleCompletedContainers
in class AbstractPollingAllocator
containerStatuses
- list of newly released containerspublic void setProgress(float progress)
ContainerAllocator
setProgress
in interface ContainerAllocator
progress
- the current progress of applicationpublic int getPriority()
public void setPriority(int priority)
priority
- the new prioritypublic java.lang.String[] getHosts()
public void setHosts(java.lang.String[] hosts)
hosts
- the new hostspublic java.lang.String[] getRacks()
public void setRacks(java.lang.String[] racks)
racks
- the new rackspublic int getVirtualcores()
public void setVirtualcores(int virtualcores)
virtualcores
- the new virtualcorespublic int getMemory()
public void setMemory(int memory)
memory
- the new memory
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |