Spring for Apache Hadoop

org.springframework.data.hadoop.test.support
Class HadoopClusterManager

java.lang.Object
  extended by org.springframework.data.hadoop.test.support.HadoopClusterManager

public class HadoopClusterManager
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(HadoopCluster cluster)
          Closes and remove HadoopCluster from a manager cache.
protected  void doClose()
          Bring down and un-register all the running clusters.
 HadoopCluster getCluster(ClusterInfo clusterInfo)
          Gets and starts the mini cluster.
static HadoopClusterManager getInstance()
          Gets the singleton instance of HadoopClusterManager.
static HadoopClusterManager getInstance(boolean registerShutdownHook)
          Gets the singleton instance of HadoopClusterManager.
 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 HadoopClusterManager getInstance()
Gets the singleton instance of HadoopClusterManager.

Returns:
the singleton instance

getInstance

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

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

getCluster

public HadoopCluster 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(HadoopCluster cluster)
Closes and remove HadoopCluster from a manager cache.

Parameters:
cluster - the Hadoop 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