public abstract class MiniMRClusterCompat
extends java.lang.Object
Usually minimr clusters are constructed via MiniMRClientClusterFactory which have same methods for hadoop 1.x and 2.x. Hadoop have this to easy testing for both versions. However at least hadoop 1.x distribution from a Cloudera(chd3, chd4) don't have this factory method for we need to resolve underlying cluster classes at runtime. Effectively these legacy classes cannot be resolved at compile time because Hadoop 2.x is based on Yarn and thus have different minimr cluster implementations.
Constructor and Description |
---|
MiniMRClusterCompat() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.conf.Configuration |
getConfiguration(java.lang.Object mrClusterObject)
Gets the
Configuration from a cluster. |
static java.lang.Object |
instantiateCluster(java.lang.Class<?> caller,
java.lang.String identifier,
int nodes,
org.apache.hadoop.conf.Configuration configuration,
org.apache.hadoop.fs.FileSystem fileSystem,
java.lang.ClassLoader classLoader)
Instantiates a minimrcluster.
|
static void |
stopCluster(java.lang.Object mrClusterObject)
Finds and calls lifecycle stop method for
given cluster via reflection.
|
public static java.lang.Object instantiateCluster(java.lang.Class<?> caller, java.lang.String identifier, int nodes, org.apache.hadoop.conf.Configuration configuration, org.apache.hadoop.fs.FileSystem fileSystem, java.lang.ClassLoader classLoader)
caller
- the one who called this methodidentifier
- the cluster identifiernodes
- number of nodesconfiguration
- passed configurationfileSystem
- hdfs filesystemclassLoader
- the class loaderpublic static void stopCluster(java.lang.Object mrClusterObject)
mrClusterObject
- the Cluster Objectpublic static org.apache.hadoop.conf.Configuration getConfiguration(java.lang.Object mrClusterObject)
Configuration
from a cluster.mrClusterObject
- the Cluster ObjectConfiguration