public final class MiniClusterUtils
extends java.lang.Object
MiniDFSCluster
for use in tests.Modifier and Type | Class and Description |
---|---|
static interface |
MiniClusterUtils.MiniClusterTest
An interface for writing tests that run on a minicluster.
|
Constructor and Description |
---|
MiniClusterUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.hdfs.MiniDFSCluster |
getMiniCluster() |
static org.apache.hadoop.hdfs.MiniDFSCluster |
getMiniCluster(org.apache.hadoop.conf.Configuration otherConf) |
static org.apache.hadoop.fs.Path |
getTempPath(org.apache.hadoop.hdfs.MiniDFSCluster cluster,
java.lang.String prefix,
java.lang.String extension) |
static org.apache.hadoop.fs.Path |
getWorkingDir(org.apache.hadoop.hdfs.MiniDFSCluster cluster) |
static void |
runOnIsolatedMiniCluster(MiniClusterUtils.MiniClusterTest test)
Create a new isolated
MiniDFSCluster , run a MiniClusterUtils.MiniClusterTest on it and then shut it down. |
static void |
stopCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster)
shut down the cluster
|
public static org.apache.hadoop.hdfs.MiniDFSCluster getMiniCluster(org.apache.hadoop.conf.Configuration otherConf) throws java.io.IOException
java.io.IOException
public static org.apache.hadoop.hdfs.MiniDFSCluster getMiniCluster() throws java.io.IOException
java.io.IOException
public static org.apache.hadoop.fs.Path getTempPath(org.apache.hadoop.hdfs.MiniDFSCluster cluster, java.lang.String prefix, java.lang.String extension) throws java.io.IOException
java.io.IOException
public static org.apache.hadoop.fs.Path getWorkingDir(org.apache.hadoop.hdfs.MiniDFSCluster cluster) throws java.io.IOException
java.io.IOException
public static void stopCluster(org.apache.hadoop.hdfs.MiniDFSCluster cluster)
public static void runOnIsolatedMiniCluster(MiniClusterUtils.MiniClusterTest test) throws java.lang.Exception
MiniDFSCluster
, run a MiniClusterUtils.MiniClusterTest
on it and then shut it down.test
- a function to run on the cluster, this should indicate success or failure by using Assert
java.lang.Exception