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, setRmTemplateafterPropertiesSet, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, getYarnEventPublisher, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, setYarnEventPublisher, start, stop, stoppublic void setTrigger(org.springframework.scheduling.Trigger trigger)
Trigger used to trigger polling tasks.trigger - trigger to setprotected void onInit()
throws java.lang.Exception
LifecycleObjectSupportInitializingBean phase. Implementor should
always call super method not to break initialization chain.onInit in class AbstractAllocatorjava.lang.Exception - exceptionprotected void doStart()
LifecycleObjectSupportLifecycleObjectSupport.lifecycleLock.doStart in class LifecycleObjectSupportprotected void doStop()
LifecycleObjectSupportLifecycleObjectSupport.lifecycleLock.doStop in class LifecycleObjectSupportprotected 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