Spring for Apache Hadoop

org.springframework.yarn.test.support
Class YarnClusterManager

java.lang.Object
  extended by org.springframework.yarn.test.support.YarnClusterManager

public class YarnClusterManager
extends java.lang.Object

Manager handling running mini clusters for tests.

Author:
Janne Valkealahti

Method Summary
 void close()
          Close the manager, removes shutdown hook and closes all running clusters.
 boolean closeCluster(YarnCluster cluster)
          Closes and remove YarnCluster from a manager cache.
protected  void doClose()
          Bring down and un-register all the running clusters.
 YarnCluster getCluster(ClusterInfo clusterInfo)
          Gets and starts the mini cluster.
static YarnClusterManager getInstance()
          Gets the singleton instance of YarnClusterManager.
static YarnClusterManager getInstance(boolean registerShutdownHook)
          Gets the singleton instance of YarnClusterManager.
 void registerShutdownHook()
          Register a jvm shutdown hook allowing manager to gracefully shutdown clusters in case that hasn't already happened.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static YarnClusterManager getInstance()
Gets the singleton instance of YarnClusterManager.

Returns:
the singleton instance

getInstance

public static YarnClusterManager getInstance(boolean registerShutdownHook)
Gets the singleton instance of YarnClusterManager.

Parameters:
registerShutdownHook - if true register shutdown hook
Returns:
the singleton instance

getCluster

public YarnCluster getCluster(ClusterInfo clusterInfo)
Gets and starts the mini cluster.

Parameters:
clusterInfo - the info about the cluster
Returns:
the running mini cluster

closeCluster

public boolean closeCluster(YarnCluster cluster)
Closes and remove YarnCluster from a manager cache.

Parameters:
cluster - the Yarn cluster
Returns:
true if cluster was closed, false otherwise

close

public void close()
Close the manager, removes shutdown hook and closes all running clusters.


registerShutdownHook

public void registerShutdownHook()
Register a jvm shutdown hook allowing manager to gracefully shutdown clusters in case that hasn't already happened. This is usually the scenario in tests.


doClose

protected void doClose()
Bring down and un-register all the running clusters.


Spring for Apache Hadoop