Spring for Apache Hadoop

org.springframework.yarn.am.container
Class AbstractLauncher

java.lang.Object
  extended by org.springframework.yarn.support.LifecycleObjectSupport
      extended by org.springframework.yarn.am.container.AbstractLauncher
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle
Direct Known Subclasses:
DefaultContainerLauncher

public abstract class AbstractLauncher
extends LifecycleObjectSupport

The base class for Container launcher implementations.

Author:
Janne Valkealahti

Nested Class Summary
protected  class AbstractLauncher.ContainerLauncherInterceptorList
          Convenient wrapper for interceptor list.
 
Constructor Summary
AbstractLauncher()
           
 
Method Summary
 void addInterceptor(ContainerLauncherInterceptor interceptor)
          Add a service interceptor to the end of the list.
protected  AppmasterCmOperations getCmTemplate(org.apache.hadoop.yarn.api.records.Container container)
          Constructs a new AppmasterCmOperations template.
 org.apache.hadoop.conf.Configuration getConfiguration()
          Gets the Yarn configuration.
 java.util.Map<java.lang.String,java.lang.String> getEnvironment()
          Gets the environment.
protected  AbstractLauncher.ContainerLauncherInterceptorList getInterceptors()
          Exposes the interceptor list for subclasses.
 ResourceLocalizer getResourceLocalizer()
          Gets the resource localizer.
 java.lang.String getUsername()
          Gets the username for launch context.
protected  void onInit()
          Subclasses may implement this for initialization logic.
 void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
          Sets the Yarn configuration.
 void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
          Sets the environment.
 void setInterceptors(java.util.List<ContainerLauncherInterceptor> interceptors)
          Set the list of channel interceptors.
 void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
          Sets the resource localizer.
 void setUsername(java.lang.String username)
          Sets the username for the launch context.
 
Methods inherited from class org.springframework.yarn.support.LifecycleObjectSupport
afterPropertiesSet, doStart, doStop, 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

AbstractLauncher

public AbstractLauncher()
Method Detail

onInit

protected void onInit()
               throws java.lang.Exception
Description copied from class: LifecycleObjectSupport
Subclasses may implement this for initialization logic. Called during the InitializingBean phase. Implementor should always call super method not to break initialization chain.

Overrides:
onInit in class LifecycleObjectSupport
Throws:
java.lang.Exception

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Gets the Yarn configuration.

Returns:
the Yarn configuration

setConfiguration

public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Sets the Yarn configuration.

Parameters:
configuration - the new Yarn configuration

getEnvironment

public java.util.Map<java.lang.String,java.lang.String> getEnvironment()
Gets the environment.

Returns:
the environment

setEnvironment

public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Sets the environment.

Parameters:
environment - the environment

setResourceLocalizer

public void setResourceLocalizer(ResourceLocalizer resourceLocalizer)
Sets the resource localizer.

Parameters:
resourceLocalizer - the new resource localizer

getResourceLocalizer

public ResourceLocalizer getResourceLocalizer()
Gets the resource localizer.

Returns:
the resource localizer

getUsername

public java.lang.String getUsername()
Gets the username for launch context.

Returns:
the username

setUsername

public void setUsername(java.lang.String username)
Sets the username for the launch context.

Parameters:
username - the new username

setInterceptors

public void setInterceptors(java.util.List<ContainerLauncherInterceptor> interceptors)
Set the list of channel interceptors. This will clear any existing interceptors.

Parameters:
interceptors - the new interceptors

addInterceptor

public void addInterceptor(ContainerLauncherInterceptor interceptor)
Add a service interceptor to the end of the list.

Parameters:
interceptor - the interceptor

getCmTemplate

protected AppmasterCmOperations getCmTemplate(org.apache.hadoop.yarn.api.records.Container container)
Constructs a new AppmasterCmOperations template.

Parameters:
container - the Container
Returns:
the constructed AppmasterCmOperations template

getInterceptors

protected AbstractLauncher.ContainerLauncherInterceptorList getInterceptors()
Exposes the interceptor list for subclasses.

Returns:
the interceptors

Spring for Apache Hadoop