Spring for Apache Hadoop

org.springframework.yarn.boot.test.junit
Class AbstractBootYarnClusterTests

java.lang.Object
  extended by org.springframework.yarn.test.junit.AbstractYarnClusterTests
      extended by org.springframework.yarn.boot.test.junit.AbstractBootYarnClusterTests
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public abstract class AbstractBootYarnClusterTests
extends AbstractYarnClusterTests

Abstract base class providing default functionality for running tests for Spring Yarn Boot based apps using Yarn mini cluster.

Author:
Janne Valkealahti

Nested Class Summary
static class AbstractBootYarnClusterTests.EmptyConfig
          Empty Spring @Configuration class which can be referenced from tests solely using JavaConfig.
 
Field Summary
 
Fields inherited from class org.springframework.yarn.test.junit.AbstractYarnClusterTests
applicationContext, configuration, yarnClient, yarnCluster
 
Constructor Summary
AbstractBootYarnClusterTests()
           
 
Method Summary
 void setYarnClient(YarnClient yarnClient)
          Sets the YarnClient.
protected  ApplicationInfo submitApplicationAndWait(java.lang.Object source, java.lang.String[] args)
          Submits application and wait state.
protected  ApplicationInfo submitApplicationAndWait(java.lang.Object source, java.lang.String[] args, long timeout, java.util.concurrent.TimeUnit unit)
          Submits application and wait state.
protected  ApplicationInfo submitApplicationAndWaitState(java.lang.Object source, java.lang.String[] args, long timeout, java.util.concurrent.TimeUnit unit, org.apache.hadoop.yarn.api.records.YarnApplicationState... applicationStates)
          Submits application and wait state.
 
Methods inherited from class org.springframework.yarn.test.junit.AbstractYarnClusterTests
getApplicationContext, getConfiguration, getState, getYarnClient, getYarnCluster, killApplication, setApplicationContext, setConfiguration, setYarnCluster, submitApplication, submitApplicationAndWait, submitApplicationAndWait, submitApplicationAndWaitState, waitState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBootYarnClusterTests

public AbstractBootYarnClusterTests()
Method Detail

setYarnClient

public void setYarnClient(YarnClient yarnClient)
Description copied from class: AbstractYarnClusterTests
Sets the YarnClient.

Overrides:
setYarnClient in class AbstractYarnClusterTests
Parameters:
yarnClient - the Yarn client

submitApplicationAndWait

protected ApplicationInfo submitApplicationAndWait(java.lang.Object source,
                                                   java.lang.String[] args)
                                            throws java.lang.Exception
Submits application and wait state. On default waits 60 seconds.

Parameters:
source - the boot application config source
args - the boot application args
Returns:
Application info for submit
Throws:
java.lang.Exception - if exception occurred
See Also:
ApplicationInfo, submitApplicationAndWaitState(Object, String[], long, TimeUnit, YarnApplicationState...)

submitApplicationAndWait

protected ApplicationInfo submitApplicationAndWait(java.lang.Object source,
                                                   java.lang.String[] args,
                                                   long timeout,
                                                   java.util.concurrent.TimeUnit unit)
                                            throws java.lang.Exception
Submits application and wait state.

Parameters:
source - the boot application config source
args - the boot application args
timeout - the timeout for wait
unit - the unit for timeout
Returns:
Application info for submit
Throws:
java.lang.Exception - if exception occurred
See Also:
ApplicationInfo, submitApplicationAndWaitState(Object, String[], long, TimeUnit, YarnApplicationState...)

submitApplicationAndWaitState

protected ApplicationInfo submitApplicationAndWaitState(java.lang.Object source,
                                                        java.lang.String[] args,
                                                        long timeout,
                                                        java.util.concurrent.TimeUnit unit,
                                                        org.apache.hadoop.yarn.api.records.YarnApplicationState... applicationStates)
                                                 throws java.lang.Exception
Submits application and wait state. Returned state is NULL if something failed or final known state after the wait/poll operations. Array of application states can be used to return immediately from wait loop if state is matched.

Parameters:
source - the boot application config source
args - the boot application args
timeout - the timeout for wait
unit - the unit for timeout
applicationStates - the application states to wait
Returns:
Application info for submit
Throws:
java.lang.Exception - if exception occurred
See Also:
ApplicationInfo

Spring for Apache Hadoop