|
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
public abstract class AbstractPollingAllocator
Base implementation of allocator which is meant to handle allocation by doing a simple periodic polling against resource manager.
Constructor Summary | |
---|---|
AbstractPollingAllocator()
|
Method Summary | |
---|---|
protected abstract org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse |
doContainerRequest()
Subclasses needs to implements this method to do container requests against resource manager. |
protected void |
doStart()
Subclasses may implement this method with the start behavior. |
protected void |
doStop()
Subclasses may implement this method with the stop behavior. |
protected abstract 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 abstract 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 void |
onInit()
Subclasses may implement this for initialization logic. |
protected void |
populateNmTokenCache(org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocateResponse)
Populate node manager token cache in NMTokenCache . |
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 |
setTrigger(org.springframework.scheduling.Trigger trigger)
Sets Trigger used to trigger polling tasks. |
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 AbstractPollingAllocator()
Method Detail |
---|
public void setTrigger(org.springframework.scheduling.Trigger trigger)
Trigger
used to trigger polling tasks.
trigger
- trigger to setprotected void onInit() throws java.lang.Exception
LifecycleObjectSupport
InitializingBean
phase. Implementor should
always call super method not to break initialization chain.
onInit
in class AbstractAllocator
java.lang.Exception
protected void doStart()
LifecycleObjectSupport
LifecycleObjectSupport.lifecycleLock
.
doStart
in class LifecycleObjectSupport
protected void doStop()
LifecycleObjectSupport
LifecycleObjectSupport.lifecycleLock
.
doStop
in class LifecycleObjectSupport
protected abstract org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse doContainerRequest()
handleAllocatedContainers(List)
and
handleCompletedContainers(List)
.
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)
containers
- the containers
protected abstract void handleAllocatedContainers(java.util.List<org.apache.hadoop.yarn.api.records.Container> containers)
containers
- list of newly allocate containersprotected abstract void handleCompletedContainers(java.util.List<org.apache.hadoop.yarn.api.records.ContainerStatus> containerStatuses)
containerStatuses
- list of newly released containersprotected void populateNmTokenCache(org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocateResponse)
NMTokenCache
.
allocateResponse
- the allocate response
|
Spring for Apache Hadoop | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |