public abstract class AbstractPollingAllocator extends AbstractAllocator
Constructor and Description |
---|
AbstractPollingAllocator() |
Modifier and Type | Method and Description |
---|---|
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. |
getApplicationAttemptId, getConfiguration, getEnvironment, getRmTemplate, setApplicationAttemptId, setConfiguration, setEnvironment, setRmTemplate
afterPropertiesSet, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stop
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
- exceptionprotected 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 containersprotected 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