Spring for Apache Hadoop

org.springframework.yarn.test.support
Class StandaloneYarnCluster

java.lang.Object
  extended by org.springframework.yarn.test.support.StandaloneYarnCluster
All Implemented Interfaces:
YarnCluster

public class StandaloneYarnCluster
extends java.lang.Object
implements YarnCluster

Standalone simple mini cluster having Yarn and Hdfs nodes.

Author:
Janne Valkealahti

Constructor Summary
StandaloneYarnCluster(java.lang.String clusterName)
          Instantiates a mini cluster with default cluster node count.
StandaloneYarnCluster(java.lang.String clusterName, int nodes)
          Instantiates a mini cluster with given cluster node count.
 
Method Summary
 org.apache.hadoop.conf.Configuration getConfiguration()
          Gets the Configuration for the cluster.
 java.io.File getYarnWorkDir()
          Gets the working directory of Yarn nodes.
 void setNodes(int nodes)
          Sets a number of nodes for cluster.
 void start()
          Starts the cluster.
 void stop()
          Stops the cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandaloneYarnCluster

public StandaloneYarnCluster(java.lang.String clusterName)
Instantiates a mini cluster with default cluster node count.

Parameters:
clusterName - the unique cluster name

StandaloneYarnCluster

public StandaloneYarnCluster(java.lang.String clusterName,
                             int nodes)
Instantiates a mini cluster with given cluster node count.

Parameters:
clusterName - the unique cluster name
nodes - the node count
Method Detail

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Description copied from interface: YarnCluster
Gets the Configuration for the cluster. As most of the configuration parameters are not known until after cluster has been started, this configuration should be configured by the cluster itself.

Specified by:
getConfiguration in interface YarnCluster
Returns:
the Cluster configured Configuration

start

public void start()
           throws java.io.IOException
Description copied from interface: YarnCluster
Starts the cluster.

Specified by:
start in interface YarnCluster
Throws:
java.io.IOException

stop

public void stop()
Description copied from interface: YarnCluster
Stops the cluster.

Specified by:
stop in interface YarnCluster

getYarnWorkDir

public java.io.File getYarnWorkDir()
Description copied from interface: YarnCluster
Gets the working directory of Yarn nodes. This directory can be used to find log files of running containers.

Specified by:
getYarnWorkDir in interface YarnCluster
Returns:
Yarn working directory.

setNodes

public void setNodes(int nodes)
Sets a number of nodes for cluster. Every node will act as yarn and dfs role. Default is one node.

Parameters:
nodes - the number of nodes

Spring for Apache Hadoop