|
@@ -38,6 +38,11 @@ public class MiniMRClientClusterFactory {
|
|
|
|
|
|
public static MiniMRClientCluster create(Class<?> caller, int noOfNMs,
|
|
|
Configuration conf) throws IOException {
|
|
|
+ return create(caller, caller.getSimpleName(), noOfNMs, conf);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static MiniMRClientCluster create(Class<?> caller, String identifier,
|
|
|
+ int noOfNMs, Configuration conf) throws IOException {
|
|
|
|
|
|
if (conf == null) {
|
|
|
conf = new Configuration();
|
|
@@ -45,7 +50,7 @@ public class MiniMRClientClusterFactory {
|
|
|
|
|
|
FileSystem fs = FileSystem.get(conf);
|
|
|
|
|
|
- Path testRootDir = new Path("target", caller.getSimpleName() + "-tmpDir")
|
|
|
+ Path testRootDir = new Path("target", identifier + "-tmpDir")
|
|
|
.makeQualified(fs);
|
|
|
Path appJar = new Path(testRootDir, "MRAppJar.jar");
|
|
|
|
|
@@ -65,10 +70,10 @@ public class MiniMRClientClusterFactory {
|
|
|
fs.setPermission(remoteCallerJar, new FsPermission("744"));
|
|
|
job.addFileToClassPath(remoteCallerJar);
|
|
|
|
|
|
- MiniMRYarnCluster miniMRYarnCluster = new MiniMRYarnCluster(caller
|
|
|
- .getSimpleName(), noOfNMs);
|
|
|
+ MiniMRYarnCluster miniMRYarnCluster = new MiniMRYarnCluster(identifier,
|
|
|
+ noOfNMs);
|
|
|
job.getConfiguration().set("minimrclientcluster.caller.name",
|
|
|
- caller.getSimpleName());
|
|
|
+ identifier);
|
|
|
job.getConfiguration().setInt("minimrclientcluster.nodemanagers.number",
|
|
|
noOfNMs);
|
|
|
miniMRYarnCluster.init(job.getConfiguration());
|