Spring for Apache Hadoop

org.springframework.yarn.container
Class AbstractYarnContainer

java.lang.Object
  extended by org.springframework.yarn.container.AbstractYarnContainer
All Implemented Interfaces:
LongRunningYarnContainer, YarnContainer
Direct Known Subclasses:
AbstractIntegrationYarnContainer

public abstract class AbstractYarnContainer
extends java.lang.Object
implements LongRunningYarnContainer

Base implementation of YarnContainer providing some common functionality like environment properties, command line parameters and handling of the run().

Author:
Janne Valkealahti

Constructor Summary
AbstractYarnContainer()
           
 
Method Summary
 void addContainerStateListener(ContainerStateListener listener)
          Adds the container state listener.
 java.util.Map<java.lang.String,java.lang.String> getEnvironment()
          Gets the environment.
 java.lang.String getEnvironment(java.lang.String key)
          Gets the environment variable.
 java.util.Properties getParameters()
          Gets the parameters.
 boolean isWaitCompleteState()
          Indication for possible handler using this bean whether it should wait COMPLETED state.
protected  void notifyCompleted()
          Notify completed state to container state listeners.
 void run()
          This method is called when something is ran in a container.
protected abstract  void runInternal()
          Internal method to handle the actual run() method.
 void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
          Sets the environment variables.
 void setParameters(java.util.Properties parameters)
          Sets the parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractYarnContainer

public AbstractYarnContainer()
Method Detail

run

public final void run()
Description copied from interface: YarnContainer
This method is called when something is ran in a container.

Specified by:
run in interface YarnContainer

setEnvironment

public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Description copied from interface: YarnContainer
Sets the environment variables. This method should be used by a launcher or any other party handling creation of a container.

Specified by:
setEnvironment in interface YarnContainer
Parameters:
environment - the environment variables

setParameters

public void setParameters(java.util.Properties parameters)
Description copied from interface: YarnContainer
Sets the parameters. This method should be used by a launcher or any other party handling being aware of a command line parameters.

Specified by:
setParameters in interface YarnContainer
Parameters:
parameters - the parameters

getEnvironment

public java.lang.String getEnvironment(java.lang.String key)
Gets the environment variable.

Parameters:
key - the key
Returns:
the environment variable or null if key doesn't exist

getEnvironment

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

Returns:
the environment

getParameters

public java.util.Properties getParameters()
Gets the parameters.

Returns:
the parameters

addContainerStateListener

public void addContainerStateListener(ContainerStateListener listener)
Description copied from interface: LongRunningYarnContainer
Adds the container state listener.

Specified by:
addContainerStateListener in interface LongRunningYarnContainer
Parameters:
listener - the ContainerStateListener

isWaitCompleteState

public boolean isWaitCompleteState()
Description copied from interface: LongRunningYarnContainer
Indication for possible handler using this bean whether it should wait COMPLETED state.

Specified by:
isWaitCompleteState in interface LongRunningYarnContainer
Returns:
True if complete state should be wait
See Also:
LongRunningYarnContainer.addContainerStateListener(ContainerStateListener)

notifyCompleted

protected void notifyCompleted()
Notify completed state to container state listeners.


runInternal

protected abstract void runInternal()
Internal method to handle the actual run() method.


Spring for Apache Hadoop